Class: X509::Certificate

Inherits:
Object
  • Object
show all
Defined in:
ossl_x509cert.c

Instance Method Summary collapse

Constructor Details

#initializeObject

Instance Method Details

#add_extensionObject

#check_private_keyObject

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;
}

#extensionsObject

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);
}

#inspectObject

#issuerObject

#issuer=Object

#not_afterObject

#not_after=Object

#not_beforeObject

#not_before=Object

#public_keyObject

#public_key=Object

#serialObject

#serial=Object

#signObject

#signature_algorithmObject

#subjectObject

#subject=Object

#to_derObject

#to_pemObject Also known as: to_s

#to_textObject

#verifyObject

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);
}

#versionObject

#version=Object