module OpenSSL::X509::Extension::AuthorityKeyIdentifier
def authority_key_identifier
Returns the binary String keyIdentifier or nil or raises
Section 4.2.1.1
authorityKeyIdentifier extension, as described in RFC5280
Get the issuing certificate's key identifier from the
def authority_key_identifier ext = find_extension("authorityKeyIdentifier") return nil if ext.nil? aki_asn1 = ASN1.decode(ext.value_der) if ext.critical? || aki_asn1.tag_class != :UNIVERSAL || aki_asn1.tag != ASN1::SEQUENCE raise ASN1::ASN1Error, "invalid extension" end key_id = aki_asn1.value.find do |v| v.tag_class == :CONTEXT_SPECIFIC && v.tag == 0 end key_id.nil? ? nil : key_id.value end