Class: CertificateAuthority::Extensions::AuthorityInfoAccess
- Inherits:
-
Object
- Object
- CertificateAuthority::Extensions::AuthorityInfoAccess
- Includes:
- ExtensionAPI
- Defined in:
- lib/certificate_authority/extensions.rb
Overview
Specifies how to access CA information and services for the CA that issued this certificate. Generally used to specify OCSP servers. Reference: Section 4.2.2.1 of RFC3280 tools.ietf.org/html/rfc3280#section-4.2.2.1
Constant Summary collapse
- OPENSSL_IDENTIFIER =
"authorityInfoAccess"
Instance Attribute Summary collapse
-
#ca_issuers ⇒ Object
Returns the value of attribute ca_issuers.
-
#critical ⇒ Object
Returns the value of attribute critical.
-
#ocsp ⇒ Object
Returns the value of attribute ocsp.
Class Method Summary collapse
Instance Method Summary collapse
- #==(o) ⇒ Object
-
#initialize ⇒ AuthorityInfoAccess
constructor
A new instance of AuthorityInfoAccess.
- #openssl_identifier ⇒ Object
- #to_s ⇒ Object
Methods included from ExtensionAPI
Constructor Details
#initialize ⇒ AuthorityInfoAccess
Returns a new instance of AuthorityInfoAccess.
266 267 268 269 270 |
# File 'lib/certificate_authority/extensions.rb', line 266 def initialize @critical = false @ocsp = [] @ca_issuers = [] end |
Instance Attribute Details
#ca_issuers ⇒ Object
Returns the value of attribute ca_issuers.
264 265 266 |
# File 'lib/certificate_authority/extensions.rb', line 264 def ca_issuers @ca_issuers end |
#critical ⇒ Object
Returns the value of attribute critical.
262 263 264 |
# File 'lib/certificate_authority/extensions.rb', line 262 def critical @critical end |
#ocsp ⇒ Object
Returns the value of attribute ocsp.
263 264 265 |
# File 'lib/certificate_authority/extensions.rb', line 263 def ocsp @ocsp end |
Class Method Details
.parse(value, critical) ⇒ Object
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 |
# File 'lib/certificate_authority/extensions.rb', line 287 def self.parse(value, critical) obj = self.new return obj if value.nil? obj.critical = critical value.split("\n").each do |v| if v =~ /^OCSP/ obj.ocsp << v.split.last end if v =~ /^CA Issuers/ obj.ca_issuers << v.split.last end end obj end |
Instance Method Details
#==(o) ⇒ Object
283 284 285 |
# File 'lib/certificate_authority/extensions.rb', line 283 def ==(o) o.class == self.class && o.state == state end |
#openssl_identifier ⇒ Object
272 273 274 |
# File 'lib/certificate_authority/extensions.rb', line 272 def openssl_identifier OPENSSL_IDENTIFIER end |
#to_s ⇒ Object
276 277 278 279 280 281 |
# File 'lib/certificate_authority/extensions.rb', line 276 def to_s res = [] res += @ocsp.map {|o| "OCSP;URI:#{o}" } res += @ca_issuers.map {|c| "caIssuers;URI:#{c}" } res.join(',') end |