Spec-Zone.ru › Ruby 4.0
  1. OpenSSL::
  2. X509::
  3. Extension::
  4. CRLDistributionPoints

модуль OpenSSL::X509::Extension::CRLDistributionPoints

Подключенные модули:
OpenSSL::X509::Extension::Helpers

Открытые методы экземпляра

crl_uris () Показать исходный код
# File ext/openssl/lib/openssl/x509.rb, line 129
def crl_uris
  ext = find_extension("crlDistributionPoints")
  return nil if ext.nil?

  cdp_asn1 = ASN1.decode(ext.value_der)
  if cdp_asn1.tag_class != :UNIVERSAL || cdp_asn1.tag != ASN1::SEQUENCE
    raise ASN1::ASN1Error, "invalid extension"
  end

  crl_uris = cdp_asn1.flat_map do |crl_distribution_point|
    distribution_point = crl_distribution_point.value.find do |v|
      v.tag_class == :CONTEXT_SPECIFIC && v.tag == 0
    end
    full_name = distribution_point&.value&.find do |v|
      v.tag_class == :CONTEXT_SPECIFIC && v.tag == 0
    end
    full_name&.value&.select do |v|
      v.tag_class == :CONTEXT_SPECIFIC && v.tag == 6 # uniformResourceIdentifier
    end
  end

  crl_uris.empty? ? nil : crl_uris.map(&:value)
end

Получает fullName distributionPoint URI из расширения точек распространения CRL сертификата, как описано в разделе 4.2.1.13 RFC 5280.

Возвращает массив строк или nil либо вызывает исключение ASN1::ASN1Error.

Ruby Core © 1993–2025 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API