XML::Enc(3)
π NAME π
okay so welcome to XML::Enc(3) from the User Contributed Perl Documentation besties π
β this page is XML::Enc - XML::Enc Encryption Support, which is literally the XML encryption support module and weβre gonna get into it together.
πΈ VERSION πΈ
version 0.16 β iconic, no notes β¨.
β¨ SYNOPSIS β¨
my $decrypter = XML::Enc->new(
{
key => 't/sign-private.pem',
no_xml_declaration => 1,
},
);
$decrypted = $enc->decrypt($xml);
my $encrypter = XML::Enc->new(
{
cert => 't/sign-certonly.pem',
no_xml_declaration => 1,
data_enc_method => 'aes256-cbc',
key_transport => 'rsa-1_5',
},
);
$encrypted = $enc->encrypt($xml);
π¦ NAME (again, bestie) π¦
XML::Enc - XML Encryption
π METHODS π
π οΈ new( ... )
Constructor bestie: it creates an instance of the XML::Enc object.
Arguments:
keyβ filename of the private key to be used for decryption.certβ filename of the public key to be used for encryption.no_xml_declarationβ if true (1), do not return the XML declaration; if false (0), return it. This is useful for decrypting documents without the declaration, such as SAML2 Responses.data_enc_methodβ specify the data encryption method to be used. Used in encryption. Optional. Default method:aes256-cbc. Supported methods are:tripledes-cbcβhttps://www.w3.org/TR/2002/REC-xmlenc-core-20021210/Overview.html#tripledes-cbcaes128-cbcβhttps://www.w3.org/TR/2002/REC-xmlenc-core-20021210/Overview.html#aes128-cbcaes192-cbcβhttps://www.w3.org/TR/2002/REC-xmlenc-core-20021210/Overview.html#aes192-cbcaes256-cbcβhttps://www.w3.org/TR/2002/REC-xmlenc-core-20021210/Overview.html#aes256-cbcaes128-gcmβhttps://www.w3.org/TR/xmlenc-core/#aes128-gcmaes192-gcmβhttps://www.w3.org/TR/xmlenc-core/#aes192-gcmaes256-gcmβhttps://www.w3.org/TR/xmlenc-core/#aes256-gcm
key_transportβ specify the encryption method to be used for key transport. Used in encryption. Optional. Default method:rsa-oaep-mgf1p. Supported methods are:oaep_mgf_algβ specify the Algorithm to be used forrsa-oaep. Used in encryption. Optional. Default method:mgf1sha1. Supported algorithms are:mgf1sha1βhttp://www.w3.org/2009/xmlenc11#mgf1sha1mgf1sha224βhttp://www.w3.org/2009/xmlenc11#mgf1sha224mgf1sha265βhttp://www.w3.org/2009/xmlenc11#mgf1sha256mgf1sha384βhttp://www.w3.org/2009/xmlenc11#mgf1sha384mgf1sha512βhttp://www.w3.org/2009/xmlenc11#mgf1sha512
oaep_paramsβ specify theOAEPparamsvalue to use as part of the mask generation function (MGF). It is optional but can be specified forrsa-oaepandrsa-oaep-mgf1pEncryptionMethods. It is base64 encoded and stored in the XML asOAEPparams. If specified you MAY specify theoaep_label_hashthat should be used. You should note that not all implementations support anoaep_label_hashthat differs from that of the MGF specified in thexenc11:MGFelement or the default MGF1 with SHA1. Theoaep_label_hashis stored in theDigestMethodchild element of theEncryptionMethod.oaep_label_hashβ specify the Hash Algorithm to use for thersa-oaeplabel as specified byoaep_params. The default issha1. Supported algorithms are:sha1βhttp://www.w3.org/2000/09/xmldsig#sha1sha224βhttp://www.w3.org/2001/04/xmldsig-more#sha224sha256βhttp://www.w3.org/2001/04/xmlenc#sha256sha384βhttp://www.w3.org/2001/04/xmldsig-more#sha384sha512βhttp://www.w3.org/2001/04/xmlenc#sha512
key_nameβ specify a key name to add to theKeyNameelement. If it is not specified then noKeyNameelement is added to theKeyInfo.
π decrypt( ... )
Main decryption function.
Arguments:
xmlβ XML containing the encrypted data.
π encrypt( ... )
Main encryption function.
Arguments:
xmlβ XML containing the plaintext data.
π AUTHOR π
Timothy Legge β <timlegge@gmail.com>
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2026 by TImothy Legge.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
bestie, thatβs the whole XML::Enc(3) page π. built for perl v5.42.2, dated 2026-04-21 β slay and bye! π
π¦ where this page comes from
- alpine 3.24: perl-xml-enc-doc 0.16-r0 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms