Class: PkiExpress::PKCertificate
- Inherits:
-
Object
- Object
- PkiExpress::PKCertificate
- Defined in:
- lib/pki_express/pk_certificate.rb
Instance Attribute Summary collapse
-
#binary_thumbprint_sha256 ⇒ Object
Returns the value of attribute binary_thumbprint_sha256.
-
#email_address ⇒ Object
Returns the value of attribute email_address.
-
#issuer ⇒ Object
Returns the value of attribute issuer.
-
#issuer_name ⇒ Object
Returns the value of attribute issuer_name.
-
#pki_brazil ⇒ Object
Returns the value of attribute pki_brazil.
-
#pki_italy ⇒ Object
Returns the value of attribute pki_italy.
-
#serial_number ⇒ Object
Returns the value of attribute serial_number.
-
#subject_name ⇒ Object
Returns the value of attribute subject_name.
-
#thumbprint ⇒ Object
Returns the value of attribute thumbprint.
-
#validity_end ⇒ Object
Returns the value of attribute validity_end.
-
#validity_start ⇒ Object
Returns the value of attribute validity_start.
Instance Method Summary collapse
-
#initialize(model) ⇒ PKCertificate
constructor
A new instance of PKCertificate.
Constructor Details
#initialize(model) ⇒ PKCertificate
Returns a new instance of PKCertificate.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/pki_express/pk_certificate.rb', line 9 def initialize(model) @subject_name = nil @email_address = nil @issuer_name = nil @serial_number = nil @validity_start = nil @validity_end = nil @pki_brazil = nil @pki_italy = nil @issuer = nil @binary_thumbprint_sha256 = nil @thumbprint = nil unless model.nil? @email_address = model.fetch(:emailAddress) @serial_number = model.fetch(:serialNumber) @validity_start = model.fetch(:validityStart) @validity_end = model.fetch(:validityEnd) @thumbprint = model.fetch(:thumbprint) subject_name = model.fetch(:subjectName) if subject_name @subject_name = Name.new(subject_name) end issuer_name = model.fetch(:issuerName) if issuer_name @issuer_name = Name.new(issuer_name) end pki_brazil = model.fetch(:pkiBrazil) if pki_brazil @pki_brazil = PkiBrazilCertificateFields.new(pki_brazil) end pki_italy = model.fetch(:pkiItaly) if pki_italy @pki_italy = PkiItalyCertificateFields.new(pki_italy) end issuer = model.fetch(:issuer) if issuer @issuer = PKCertificate.new(issuer) end binary_thumbprint_sha256 = model.fetch(:binaryThumbprintSHA256) if binary_thumbprint_sha256 @binary_thumbprint_sha256 = Base64.decode64(binary_thumbprint_sha256) end end end |
Instance Attribute Details
#binary_thumbprint_sha256 ⇒ Object
Returns the value of attribute binary_thumbprint_sha256.
5 6 7 |
# File 'lib/pki_express/pk_certificate.rb', line 5 def binary_thumbprint_sha256 @binary_thumbprint_sha256 end |
#email_address ⇒ Object
Returns the value of attribute email_address.
5 6 7 |
# File 'lib/pki_express/pk_certificate.rb', line 5 def email_address @email_address end |
#issuer ⇒ Object
Returns the value of attribute issuer.
5 6 7 |
# File 'lib/pki_express/pk_certificate.rb', line 5 def issuer @issuer end |
#issuer_name ⇒ Object
Returns the value of attribute issuer_name.
5 6 7 |
# File 'lib/pki_express/pk_certificate.rb', line 5 def issuer_name @issuer_name end |
#pki_brazil ⇒ Object
Returns the value of attribute pki_brazil.
5 6 7 |
# File 'lib/pki_express/pk_certificate.rb', line 5 def pki_brazil @pki_brazil end |
#pki_italy ⇒ Object
Returns the value of attribute pki_italy.
5 6 7 |
# File 'lib/pki_express/pk_certificate.rb', line 5 def pki_italy @pki_italy end |
#serial_number ⇒ Object
Returns the value of attribute serial_number.
5 6 7 |
# File 'lib/pki_express/pk_certificate.rb', line 5 def serial_number @serial_number end |
#subject_name ⇒ Object
Returns the value of attribute subject_name.
5 6 7 |
# File 'lib/pki_express/pk_certificate.rb', line 5 def subject_name @subject_name end |
#thumbprint ⇒ Object
Returns the value of attribute thumbprint.
5 6 7 |
# File 'lib/pki_express/pk_certificate.rb', line 5 def thumbprint @thumbprint end |
#validity_end ⇒ Object
Returns the value of attribute validity_end.
5 6 7 |
# File 'lib/pki_express/pk_certificate.rb', line 5 def validity_end @validity_end end |
#validity_start ⇒ Object
Returns the value of attribute validity_start.
5 6 7 |
# File 'lib/pki_express/pk_certificate.rb', line 5 def validity_start @validity_start end |