module

SAML::XMLSecurity

Constants

C14N = "http://www.w3.org/2001/10/xml-exc-c14n#"
DSIG = "http://www.w3.org/2000/09/xmldsig#"
ENVELOPED_SIG = "http://www.w3.org/2000/09/xmldsig#enveloped-signature"
INC_PREFIX_LIST = "#default samlp saml ds xs xsi md"
RSA_SHA1 = "http://www.w3.org/2000/09/xmldsig#rsa-sha1"

Signature algorithm URIs

RSA_SHA256 = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"
RSA_SHA384 = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha384"
RSA_SHA512 = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"
SHA1 = "http://www.w3.org/2000/09/xmldsig#sha1"

Digest algorithm URIs

SHA256 = "http://www.w3.org/2001/04/xmlenc#sha256"
SHA384 = "http://www.w3.org/2001/04/xmldsig-more#sha384"
SHA512 = "http://www.w3.org/2001/04/xmlenc#sha512"

Instance methods

canon_algorithm(algorithm : String) : String

Parse canonicalization algorithm URI to openssl digest type

Source
canonicalize(xml : String, inclusive_prefixes : Array(String) = [] of String) : String

Canonicalize XML using Exclusive Canonicalization (xml-exc-c14n#) Implements the W3C Exclusive XML Canonicalization specification https://www.w3.org/TR/xml-exc-c14n/

Source
safe_parse(xml : String) : XML::Node

Validate that XML is safe (no DOCTYPE, etc.)

Source
sign_document(xml : String, private_key : OpenSSL::PKey::RSA, certificate : OpenSSL::X509::Certificate, uuid : String, signature_method : String = RSA_SHA1, digest_method : String = SHA1) : String

Sign an XML document

Source
signature_algorithm(algorithm : String) : OpenSSL::Digest

Parse signature/digest algorithm URI to OpenSSL digest type

Source
validate_signature(xml : String, certificate : OpenSSL::X509::Certificate) : Bool

Validate XML signature

Source