Class: X509::Certificate
- Inherits:
-
Object
- Object
- X509::Certificate
- Defined in:
- ossl_x509cert.c
Instance Method Summary collapse
- #add_extension ⇒ Object
-
#check_private_key ⇒ Object
Checks if 'key' is PRIV key for this cert.
-
#extensions ⇒ Object
Gets X509v3 extensions as array of X509Ext objects.
-
#extensions= ⇒ Object
Sets X509_EXTENSIONs.
- #initialize ⇒ Object constructor
- #inspect ⇒ Object
- #issuer ⇒ Object
- #issuer= ⇒ Object
- #not_after ⇒ Object
- #not_after= ⇒ Object
- #not_before ⇒ Object
- #not_before= ⇒ Object
- #public_key ⇒ Object
- #public_key= ⇒ Object
- #serial ⇒ Object
- #serial= ⇒ Object
- #sign ⇒ Object
- #signature_algorithm ⇒ Object
- #subject ⇒ Object
- #subject= ⇒ Object
- #to_der ⇒ Object
- #to_pem ⇒ Object (also: #to_s)
- #to_text ⇒ Object
-
#verify ⇒ Object
Checks that cert signature is made with PRIVversion of this PUBLIC 'key'.
- #version ⇒ Object
- #version= ⇒ Object
Constructor Details
#initialize ⇒ Object
Instance Method Details
#add_extension ⇒ Object
#check_private_key ⇒ Object
Checks if 'key' is PRIV key for this cert
|
# File 'ossl_x509cert.c'
static VALUE
ossl_x509_check_private_key(VALUE self, VALUE key)
{
X509 *x509;
EVP_PKEY *pkey;
/* not needed private key, but should be */
pkey = GetPrivPKeyPtr(key); /* NO NEED TO DUP */
GetX509(self, x509);
if (!X509_check_private_key(x509, pkey)) {
OSSL_Warning("Check private key:%s", OSSL_ErrMsg());
return Qfalse;
}
|
#extensions ⇒ Object
Gets X509v3 extensions as array of X509Ext objects
|
# File 'ossl_x509cert.c'
static VALUE
ossl_x509_get_extensions(VALUE self)
{
X509 *x509;
int count, i;
X509_EXTENSION *ext;
VALUE ary;
GetX509(self, x509);
count = X509_get_ext_count(x509);
if (count < 0) {
return rb_ary_new();
}
|
#extensions= ⇒ Object
Sets X509_EXTENSIONs
|
# File 'ossl_x509cert.c'
static VALUE
ossl_x509_set_extensions(VALUE self, VALUE ary)
{
X509 *x509;
X509_EXTENSION *ext;
int i;
Check_Type(ary, T_ARRAY);
/* All ary's members should be X509Extension */
for (i=0; i<RARRAY(ary)->len; i++) {
OSSL_Check_Kind(RARRAY(ary)->ptr[i], cX509Ext);
}
|
#inspect ⇒ Object
#issuer ⇒ Object
#issuer= ⇒ Object
#not_after ⇒ Object
#not_after= ⇒ Object
#not_before ⇒ Object
#not_before= ⇒ Object
#public_key ⇒ Object
#public_key= ⇒ Object
#serial ⇒ Object
#serial= ⇒ Object
#sign ⇒ Object
#signature_algorithm ⇒ Object
#subject ⇒ Object
#subject= ⇒ Object
#to_der ⇒ Object
#to_pem ⇒ Object Also known as: to_s
#to_text ⇒ Object
#verify ⇒ Object
Checks that cert signature is made with PRIVversion of this PUBLIC 'key'
|
# File 'ossl_x509cert.c'
static VALUE
ossl_x509_verify(VALUE self, VALUE key)
{
X509 *x509;
EVP_PKEY *pkey;
int i;
pkey = GetPKeyPtr(key); /* NO NEED TO DUP */
GetX509(self, x509);
if ((i = X509_verify(x509, pkey)) < 0) {
ossl_raise(eX509CertError, NULL);
}
|