Class: Samlr::Certificate
Instance Attribute Summary collapse
-
#x509 ⇒ Object
readonly
Returns the value of attribute x509.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #fingerprint ⇒ Object
-
#initialize(value) ⇒ Certificate
constructor
A new instance of Certificate.
Constructor Details
#initialize(value) ⇒ Certificate
Returns a new instance of Certificate.
5 6 7 8 9 10 11 12 13 |
# File 'lib/samlr/certificate.rb', line 5 def initialize(value) @x509 = if value.is_a?(OpenSSL::X509::Certificate) value elsif value.is_a?(IO) OpenSSL::X509::Certificate.new(value.read) else OpenSSL::X509::Certificate.new(value) end end |
Instance Attribute Details
#x509 ⇒ Object (readonly)
Returns the value of attribute x509.
3 4 5 |
# File 'lib/samlr/certificate.rb', line 3 def x509 @x509 end |
Instance Method Details
#==(other) ⇒ Object
19 20 21 |
# File 'lib/samlr/certificate.rb', line 19 def ==(other) other.is_a?(Certificate) && fingerprint == other.fingerprint end |
#fingerprint ⇒ Object
15 16 17 |
# File 'lib/samlr/certificate.rb', line 15 def fingerprint @fingerprint ||= FingerprintSHA256.new(@x509) end |