class XMLSecurity::BaseDocument

Overview

A parsed XML document. Forwards the XML::Node API to the parsed tree.

Direct Known Subclasses

Defined in:

saml/xml_security.cr

Constant Summary

C14N = "http://www.w3.org/2001/10/xml-exc-c14n#"
C14N_ALGORITHMS = {"http://www.w3.org/TR/2001/REC-xml-c14n-20010315" => {XML::C14N::Mode::C14N_1_0, false}, "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" => {XML::C14N::Mode::C14N_1_0, true}, "http://www.w3.org/2006/12/xml-c14n11" => {XML::C14N::Mode::C14N_1_1, false}, "http://www.w3.org/2006/12/xml-c14n11#WithComments" => {XML::C14N::Mode::C14N_1_1, true}, "http://www.w3.org/2001/10/xml-exc-c14n#" => {XML::C14N::Mode::C14N_EXCLUSIVE_1_0, false}, "http://www.w3.org/2001/10/xml-exc-c14n#WithComments" => {XML::C14N::Mode::C14N_EXCLUSIVE_1_0, true}}
DIGEST_ALGORITHMS = {"http://www.w3.org/2000/09/xmldsig#sha1" => "SHA1", "http://www.w3.org/2001/04/xmlenc#sha1" => "SHA1", "http://www.w3.org/2001/04/xmlenc#sha384" => "SHA384", "http://www.w3.org/2001/04/xmlenc#sha256" => "SHA256", "http://www.w3.org/2001/04/xmldsig-more#sha256" => "SHA256", "http://www.w3.org/2001/04/xmldsig-more#sha384" => "SHA384", "http://www.w3.org/2001/04/xmlenc#sha512" => "SHA512", "http://www.w3.org/2001/04/xmldsig-more#sha512" => "SHA512"}
DSIG = "http://www.w3.org/2000/09/xmldsig#"
SIGNATURE_ALGORITHMS = {"http://www.w3.org/2000/09/xmldsig#rsa-sha1" => "SHA1", "http://www.w3.org/2001/04/xmldsig-more#rsa-sha1" => "SHA1", "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" => "SHA256", "http://www.w3.org/2001/04/xmldsig-more#rsa-sha384" => "SHA384", "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512" => "SHA512"}
XML_PARSER_OPTIONS = Saml::XMLUtil::PARSER_OPTIONS

Constructors

Class Method Summary

Macro Summary

Instance Method Summary

Constructor Detail

def self.new(xml_document : XML::Node) #

[View source]

Class Method Detail

def self.algorithm(element : XML::Node | String | Nil) : OpenSSL::Digest #

Legacy mapping from an algorithm URI to a fresh digest; unknown means SHA1.


[View source]
def self.canon_algorithm(element) #

Legacy mapping: unknown algorithms fall back to exclusive c14n.


[View source]
def self.pem_to_der(pem : String) #

[View source]
def self.safe_load_xml(document) : XML::Node #

Loads untrusted XML strictly (see Saml::XMLUtil.safe_parse).


[View source]
def self.strict_digest(uri : String | Nil, table) : OpenSSL::Digest | Nil #

The digest for a signature or digest method URI, nil when it isn't supported.


[View source]

Macro Detail

macro method_missing(call) #

[View source]

Instance Method Detail

def pem_to_der(pem : String) #

[View source]
def to_s(io : IO) : Nil #
Description copied from class Reference

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>

[View source]
def to_s : String #

Serialised without formatting changes.


[View source]
def to_xml : String #

[View source]
def xml_document : XML::Node #

[View source]