|
| 1 | +NAME |
| 2 | + XML::Enc - XML::Enc Encryption Support |
| 3 | + |
| 4 | +VERSION |
| 5 | + version 0.01 |
| 6 | + |
| 7 | +SYNOPSIS |
| 8 | + my $decrypter = XML::Enc->new( |
| 9 | + { |
| 10 | + key => 't/sign-private.pem', |
| 11 | + no_xml_declaration => 1, |
| 12 | + force_element_to_content => 0, |
| 13 | + }, |
| 14 | + ); |
| 15 | + $decrypted = $enc->decrypt($xml); |
| 16 | + |
| 17 | + my $encrypter = XML::Enc->new( |
| 18 | + { |
| 19 | + cert => 't/sign-certonly.pem', |
| 20 | + no_xml_declaration => 1, |
| 21 | + data_enc_method => 'aes256-cbc', |
| 22 | + key_transport => 'rsa-1_5', |
| 23 | + |
| 24 | + }, |
| 25 | + ); |
| 26 | + $encrypted = $enc->encrypt($xml); |
| 27 | + |
| 28 | +NAME |
| 29 | + XML::Enc - XML Encryption |
| 30 | + |
| 31 | +METHODS |
| 32 | + new( ... ) |
| 33 | + Constructor. Creates an instance of the XML::Enc object |
| 34 | + |
| 35 | + Arguments: |
| 36 | + |
| 37 | + key Filename of the private key to be used for decryption. |
| 38 | + |
| 39 | + cert |
| 40 | + Filename of the public key to be used for encryption. |
| 41 | + |
| 42 | + no_xml_declaration |
| 43 | + Do not return the XML declaration if true (1). Return it if false |
| 44 | + (0). This is useful for decrypting documents without the declaration |
| 45 | + such as SAML2 Responses. |
| 46 | + |
| 47 | + data_enc_method |
| 48 | + Specify the data encryption method to be used. Supported methods |
| 49 | + are: |
| 50 | + |
| 51 | + Used in encryption. Optional. Default method: aes256-cbc |
| 52 | + |
| 53 | + force_element_to_content |
| 54 | + Used for decryption to treat an Element EncryptedData type as |
| 55 | + Content if the decrypted data is not XML. xmlsec appears to have a |
| 56 | + bug where it uses the Element EncryptedData type in order to encrypt |
| 57 | + what is actually Content. Strangely it appears to have no issue |
| 58 | + decrypting the data if the Type is changed to Content |
| 59 | + |
| 60 | + * tripledes-cbc |
| 61 | + |
| 62 | + * aes128-cbc |
| 63 | + |
| 64 | + * aes196-cbc |
| 65 | + |
| 66 | + * aes256-cbc |
| 67 | + |
| 68 | + key_transport |
| 69 | + Specify the encryption method to be used for key transport. |
| 70 | + Supported methods are: |
| 71 | + |
| 72 | + Used in encryption. Optional. Default method: rsa-1_5 |
| 73 | + |
| 74 | + * rsa-1_5 |
| 75 | + |
| 76 | + * rsa-oaep-mgf1p |
| 77 | + |
| 78 | + decrypt( ... ) |
| 79 | + Main decryption function. |
| 80 | + |
| 81 | + Arguments: |
| 82 | + |
| 83 | + xml XML containing the encrypted data. |
| 84 | + |
| 85 | + encrypt( ... ) |
| 86 | + Main encryption function. |
| 87 | + |
| 88 | + Arguments: |
| 89 | + |
| 90 | + xml XML containing the plaintext data. |
| 91 | + |
| 92 | +AUTHOR |
| 93 | + Timothy Legge <timlegge@cpan.org> |
| 94 | + |
| 95 | +COPYRIGHT AND LICENSE |
| 96 | + This software is copyright (c) 2022 by TImothy Legge. |
| 97 | + |
| 98 | + This is free software; you can redistribute it and/or modify it under |
| 99 | + the same terms as the Perl 5 programming language system itself. |
| 100 | + |
0 commit comments