Class: Saml::Kit::Signature
- Inherits:
-
Object
- Object
- Saml::Kit::Signature
- Defined in:
- lib/saml/kit/signature.rb
Instance Method Summary collapse
- #certificate ⇒ Object
-
#initialize(xml_hash) ⇒ Signature
constructor
A new instance of Signature.
- #to_h ⇒ Object
- #trusted?(metadata) ⇒ Boolean
Constructor Details
#initialize(xml_hash) ⇒ Signature
Returns a new instance of Signature.
4 5 6 |
# File 'lib/saml/kit/signature.rb', line 4 def initialize(xml_hash) @xml_hash = xml_hash end |
Instance Method Details
#certificate ⇒ Object
8 9 10 11 12 |
# File 'lib/saml/kit/signature.rb', line 8 def certificate value = to_h.fetch('KeyInfo', {}).fetch('X509Data', {}).fetch('X509Certificate', nil) return if value.nil? Saml::Kit::Certificate.new(value, use: :signing) end |
#to_h ⇒ Object
19 20 21 |
# File 'lib/saml/kit/signature.rb', line 19 def to_h @xml_hash end |
#trusted?(metadata) ⇒ Boolean
14 15 16 17 |
# File 'lib/saml/kit/signature.rb', line 14 def trusted?() return false if .nil? .matches?(certificate.fingerprint, use: :signing) end |