Class: Saml::Kit::KeyPair
- Inherits:
-
Object
- Object
- Saml::Kit::KeyPair
- Defined in:
- lib/saml/kit/key_pair.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#certificate ⇒ Object
readonly
Returns the value of attribute certificate.
-
#private_key ⇒ Object
readonly
Returns the value of attribute private_key.
-
#use ⇒ Object
readonly
Returns the value of attribute use.
Instance Method Summary collapse
- #for?(use) ⇒ Boolean
-
#initialize(certificate, private_key, password, use) ⇒ KeyPair
constructor
A new instance of KeyPair.
Constructor Details
#initialize(certificate, private_key, password, use) ⇒ KeyPair
Returns a new instance of KeyPair.
6 7 8 9 10 |
# File 'lib/saml/kit/key_pair.rb', line 6 def initialize(certificate, private_key, password, use) @use = use @certificate = Saml::Kit::Certificate.new(certificate, use: use) @private_key = OpenSSL::PKey::RSA.new(private_key, password) end |
Instance Attribute Details
#certificate ⇒ Object (readonly)
Returns the value of attribute certificate.
4 5 6 |
# File 'lib/saml/kit/key_pair.rb', line 4 def certificate @certificate end |
#private_key ⇒ Object (readonly)
Returns the value of attribute private_key.
4 5 6 |
# File 'lib/saml/kit/key_pair.rb', line 4 def private_key @private_key end |
#use ⇒ Object (readonly)
Returns the value of attribute use.
4 5 6 |
# File 'lib/saml/kit/key_pair.rb', line 4 def use @use end |
Instance Method Details
#for?(use) ⇒ Boolean
12 13 14 |
# File 'lib/saml/kit/key_pair.rb', line 12 def for?(use) @use == use end |