See ASN1Data#to_der
for details.
The long name of the ObjectId
, as defined in <openssl/objects.h>.
Returns the DER encoding of this SPKI
.
Adds a nonce to the OCSP
request. If no nonce is given a random one will be generated.
The nonce is used to prevent replay attacks but some servers do not support it.
Checks the nonce validity for this request and response.
The return value is one of the following:
nonce in request only.
nonces both present and not equal.
nonces present and equal.
nonces both absent.
nonce present in response only.
For most responses, clients can check result > 0. If a responder doesn’t handle nonces result.nonzero?
may be necessary. A result of 0
is always an error.
Returns this request as a DER-encoded string
Returns this response as a DER-encoded string.
Adds nonce to this response. If no nonce was provided a random nonce will be added.
Encodes this basic response into a DER-encoded string.
Returns the status of the certificate identified by the certid. The return value may be one of these constant:
V_CERTSTATUS_GOOD
V_CERTSTATUS_REVOKED
V_CERTSTATUS_UNKNOWN
When the status is V_CERTSTATUS_REVOKED, the time at which the certificate was revoked can be retrieved by revocation_time
.
Encodes this SingleResponse
into a DER-encoded string.
Compares this certificate id’s issuer with other and returns true
if they are the same.
Encodes this certificate identifier into a DER-encoded string.
Encodes this DH
to its DER encoding. Note that any existing per-session public/private keys will not get encoded, just the Diffie-Hellman parameters will be encoded.
Generates a private and public key unless a private key already exists. If this DH
instance was generated from public DH
parameters (e.g. by encoding the result of DH#public_key
), then this method needs to be called first in order to generate the per-session keys before performing the actual key exchange.
dh = OpenSSL::PKey::DH.new(2048) public_key = dh.public_key #contains no private/public key yet public_key.generate_key! puts public_key.private? # => true
Sets p, q, g to the DH
instance.
Sets pub_key and priv_key for the DH
instance. priv_key may be nil
.
Encodes this DSA
to its DER encoding.
Sets p, q, g to the DSA
instance.
Sets pub_key and priv_key for the DSA
instance. priv_key may be nil
.
Obtains a list of all predefined curves by the OpenSSL
. Curve names are returned as sn.
See the OpenSSL
documentation for EC_get_builtin_curves().
Generates a new random private and public key.
See also the OpenSSL
documentation for EC_KEY_generate_key()
ec = OpenSSL::PKey::EC.new("prime256v1") p ec.private_key # => nil ec.generate_key! p ec.private_key # => #<OpenSSL::BN XXXXXX>
See the OpenSSL
documentation for i2d_ECPrivateKey_bio()
Generates a new random private and public key.
See also the OpenSSL
documentation for EC_KEY_generate_key()
ec = OpenSSL::PKey::EC.new("prime256v1") p ec.private_key # => nil ec.generate_key! p ec.private_key # => #<OpenSSL::BN XXXXXX>