Class: Mantra::Certificate::DigitalCertificate
- Inherits:
-
Object
- Object
- Mantra::Certificate::DigitalCertificate
- Defined in:
- lib/mantra/certificate.rb
Constant Summary collapse
- TEMPLATE_MESSAGE =
"Difital Certificate from file:"
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #certificate? ⇒ Boolean
-
#initialize(options) ⇒ DigitalCertificate
constructor
A new instance of DigitalCertificate.
- #private_key? ⇒ Boolean
- #public_key? ⇒ Boolean
- #scope ⇒ Object
Constructor Details
#initialize(options) ⇒ DigitalCertificate
Returns a new instance of DigitalCertificate.
6 7 8 9 10 |
# File 'lib/mantra/certificate.rb', line 6 def initialize() self.path = [:path] self.type = [:type].strip self.value = [:value].strip end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
5 6 7 |
# File 'lib/mantra/certificate.rb', line 5 def path @path end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/mantra/certificate.rb', line 5 def type @type end |
#value ⇒ Object
Returns the value of attribute value.
5 6 7 |
# File 'lib/mantra/certificate.rb', line 5 def value @value end |
Instance Method Details
#certificate? ⇒ Boolean
20 21 22 |
# File 'lib/mantra/certificate.rb', line 20 def certificate? self.type == "CERTIFICATE" end |
#private_key? ⇒ Boolean
12 13 14 |
# File 'lib/mantra/certificate.rb', line 12 def private_key? self.type.include? "PRIVATE KEY" end |
#public_key? ⇒ Boolean
16 17 18 |
# File 'lib/mantra/certificate.rb', line 16 def public_key? self.type == "PUBLIC KEY" end |
#scope ⇒ Object
24 25 26 |
# File 'lib/mantra/certificate.rb', line 24 def scope self.path.to_scope end |