Method: Saml::Elements::KeyInfo#initialize

Defined in:
lib/saml/elements/key_info.rb

#initialize(cert = nil) ⇒ KeyInfo

Returns a new instance of KeyInfo.



18
19
20
21
22
23
24
25
# File 'lib/saml/elements/key_info.rb', line 18

def initialize(cert = nil)
  if cert
    self.x509Data = X509Data.new(cert)
  end
  if self.x509Data && self.x509Data.x509certificate
    self.key_name = Digest::SHA1.hexdigest(self.x509Data.x509certificate.to_der)
  end
end