123456789_123456789_123456789_123456789_123456789_

Class: OpenSSL::X509::Extension

Relationships & Source Files
Inherits: Object
Defined in: ext/openssl/ossl_x509ext.c,
ext/openssl/lib/openssl/x509.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(asn1) .new(name, value) .new(name, value, critical)

Creates an ::OpenSSL::X509 extension.

The extension may be created from asn1 data or from an extension name and #value. The name may be either an OID or an extension name. If critical is true the extension is marked critical.

Instance Attribute Details

#critical=(flag) (rw)

#critical?Boolean (rw)

#oid (rw)

#oid=(oid) (rw)

#value (rw)

#value=(data) (rw)

Instance Method Details

#to_a

[ GitHub ]

  
# File 'ext/openssl/lib/openssl/x509.rb', line 55

def to_a
  [ self.oid, self.value, self.critical? ]
end

#to_der

#to_h

“value”=>value, “critical”=>true|false

[ GitHub ]

  
# File 'ext/openssl/lib/openssl/x509.rb', line 51

def to_h # {"oid"=>sn|ln, "value"=>value, "critical"=>true|false}
  {"oid"=>self.oid,"value"=>self.value,"critical"=>self.critical?}
end

#to_s

“oid = critical, value”

[ GitHub ]

  
# File 'ext/openssl/lib/openssl/x509.rb', line 44

def to_s # "oid = critical, value"
  str = self.oid
  str << " = "
  str << "critical, " if self.critical?
  str << self.value.gsub(/\n/, ", ")
end