Class: CertificateAuthority::Extensions::SubjectKeyIdentifier

Inherits:
Object
  • Object
show all
Includes:
ExtensionAPI
Defined in:
lib/certificate_authority/extensions.rb

Overview

Identifies the public key associated with a given certificate. Should be required for “CA” certificates. Reference: Section 4.2.1.2 of RFC3280 tools.ietf.org/html/rfc3280#section-4.2.1.2

Constant Summary collapse

OPENSSL_IDENTIFIER =
"subjectKeyIdentifier"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ExtensionAPI

#config_extensions

Constructor Details

#initializeSubjectKeyIdentifier

Returns a new instance of SubjectKeyIdentifier.



175
176
177
178
# File 'lib/certificate_authority/extensions.rb', line 175

def initialize
  @critical = false
  @identifier = "hash"
end

Instance Attribute Details

#criticalObject

Returns the value of attribute critical.



172
173
174
# File 'lib/certificate_authority/extensions.rb', line 172

def critical
  @critical
end

#identifierObject

Returns the value of attribute identifier.



173
174
175
# File 'lib/certificate_authority/extensions.rb', line 173

def identifier
  @identifier
end

Class Method Details

.parse(value, critical) ⇒ Object



194
195
196
197
198
199
200
# File 'lib/certificate_authority/extensions.rb', line 194

def self.parse(value, critical)
  obj = self.new
  return obj if value.nil?
  obj.critical = critical
  obj.identifier = value
  obj
end

Instance Method Details

#==(o) ⇒ Object



190
191
192
# File 'lib/certificate_authority/extensions.rb', line 190

def ==(o)
  o.class == self.class && o.state == state
end

#openssl_identifierObject



180
181
182
# File 'lib/certificate_authority/extensions.rb', line 180

def openssl_identifier
  OPENSSL_IDENTIFIER
end

#to_sObject



184
185
186
187
188
# File 'lib/certificate_authority/extensions.rb', line 184

def to_s
  res = []
  res << @identifier
  res.join(',')
end