Class: Rex::Proto::Kerberos::Model::Pkinit::Certificate
- Inherits:
-
Object
- Object
- Rex::Proto::Kerberos::Model::Pkinit::Certificate
- Defined in:
- lib/rex/proto/kerberos/model/pkinit.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Rather than specifying the entire structure of a certificate, we pass this off to OpenSSL, effectively providing an interface between RASN and OpenSSL.
Instance Method Summary collapse
-
#can_build? ⇒ Boolean
RASN1 Glue method - Say if DER can be built (not default value, not optional without value, has a value).
-
#initialize(options = {}) ⇒ Certificate
constructor
A new instance of Certificate.
- #parse!(str, ber: false) ⇒ Object
-
#primitive? ⇒ Boolean
RASN1 Glue method.
- #to_der ⇒ Object
-
#value ⇒ Object
RASN1 Glue method.
Constructor Details
#initialize(options = {}) ⇒ Certificate
Returns a new instance of Certificate.
38 39 40 |
# File 'lib/rex/proto/kerberos/model/pkinit.rb', line 38 def initialize(={}) self. = end |
Instance Attribute Details
#options ⇒ Object
Rather than specifying the entire structure of a certificate, we pass this off to OpenSSL, effectively providing an interface between RASN and OpenSSL.
36 37 38 |
# File 'lib/rex/proto/kerberos/model/pkinit.rb', line 36 def @options end |
Instance Method Details
#can_build? ⇒ Boolean
RASN1 Glue method - Say if DER can be built (not default value, not optional without value, has a value)
49 50 51 |
# File 'lib/rex/proto/kerberos/model/pkinit.rb', line 49 def can_build? !to_der.empty? end |
#parse!(str, ber: false) ⇒ Object
63 64 65 66 |
# File 'lib/rex/proto/kerberos/model/pkinit.rb', line 63 def parse!(str, ber: false) self.[:openssl_certificate] = OpenSSL::X509::Certificate.new(str) to_der.length end |
#primitive? ⇒ Boolean
RASN1 Glue method
54 55 56 |
# File 'lib/rex/proto/kerberos/model/pkinit.rb', line 54 def primitive? false end |
#to_der ⇒ Object
42 43 44 |
# File 'lib/rex/proto/kerberos/model/pkinit.rb', line 42 def to_der self.[:openssl_certificate]&.to_der || '' end |
#value ⇒ Object
RASN1 Glue method
59 60 61 |
# File 'lib/rex/proto/kerberos/model/pkinit.rb', line 59 def value [:openssl_certificate] end |