Name

SPVM::Net::SSLeay::X509 - X509 data structure in OpenSSL

Description

Net::SSLeay::X509 class in SPVM represents X509 data structure in OpenSSL.

Usage

use Net::SSLeay::X509;

Instance Methods

get_issuer_name

method get_issuer_name : Net::SSLeay::X509_NAME ();

Calls native X509_get_issuer_name function, creates a new Net::SSLeay::X509_NAME object, sets the pointer value of the new object to the return vlaue of the native function, and returns the new object.

The no_free flag of the new object is set to 1.

get_subject_name

method get_subject_name : Net::SSLeay::X509_NAME ();

Calls native X509_get_subject_name function, creates a new Net::SSLeay::X509_NAME object, sets the pointer value of the new object to the return vlaue of the native function, and returns the new object.

The no_free flag of the new object is set to 1.

digest

method digest : int ($type : Net::SSLeay::EVP_MD, $md : mutable string, $len_ref : int*);

Calls native X509_digest function given the pointer value of the instance, $type, the pointer value of $md, $len_ref, and returns its return value.

Exceptions:

The digest type $type must be defined. Otherwise an exception is thrown.

The output buffer $md must be defined. Otherwise an exception is thrown.

The length of output buffer $md must be greater than or equal to EVP_MAX_MD_SIZE. Otherwise an exception is thrown.

If X509_digest failed, an exception is thrown with eval_error_id set to the basic type ID of Net::SSLeay::Error class.

digest_return_string

method digest_return_string : string ($type : Net::SSLeay::EVP_MD);

Calls "digest" method given appropriate arguments, and returns the output string.

pubkey_digest

method pubkey_digest : int ($type : Net::SSLeay::EVP_MD, $md : mutable string, $len_ref : int*);

Calls native X509_pubkey_digest function given the pointer value of the instance, $type, the pointer value of $md, $len_ref, and returns its return value.

Exceptions:

The digest type $type must be defined. Otherwise an exception is thrown.

The output buffer $md must be defined. Otherwise an exception is thrown.

The length of output buffer $md must be greater than or equal to EVP_MAX_MD_SIZE. Otherwise an exception is thrown.

If X509_pubkey_digest failed, an exception is thrown with eval_error_id set to the basic type ID of Net::SSLeay::Error class.

pubkey_digest_return_string

method pubkey_digest_return_string : string ($type : Net::SSLeay::EVP_MD);

Calls "pubkey_digest" method given appropriate arguments, and returns the output string.

dup

method dup : Net::SSLeay::X509 ();

Calls native X509_dup function given the pointer value of the instance, creates a new Net::SSLeay::X509 object, sets the pointer value of the new object to the return value of the native function, and returns the new object.

check_issued

method check_issued : int ($subject : Net::SSLeay::X509);

Calls native X509_check_issued function given the pointer value of the instance, the pointer value of $subject, and returns its return value.

Exceptions:

The X509 object $subject must be defined. Otherwise an exception is thrown.

get_ocsp_uri

method get_ocsp_uri : string ();

Returns OCSP URI in the certificate $cert.

If not found, returns undef.

get_ext_by_NID

method get_ext_by_NID : int ($nid : int, $lastpos : int);

Calls native X509_get_ext_by_NID function given the pointer value of the instance, $nid, $lastpos, and returns its return value.

Exceptions:

If X509_get_ext_by_NID failed, an exception is thrown with eval_error_id set to the basic type ID of Net::SSLeay::Error class.

get_ext_by_OBJ

method get_ext_by_OBJ : int ($obj : Net::SSLeay::ASN1_OBJECT, $lastpos : int);

Calls native X509_get_ext_by_OBJ function given the pointer value of the instance, $obj, $lastpos, and returns its return value.

Exceptions:

If X509_get_ext_by_OBJ failed, an exception is thrown with eval_error_id set to the basic type ID of Net::SSLeay::Error class.

get_ext_count

method get_ext_count : int ();

Calls native X509_get_ext_count function given the pointer value of the instance, and returns its return value.

get_ext

method get_ext : Net::SSLeay::X509_EXTENSION ($loc : int);

Calls native X509_get_ext function given the pointer value of the instance, $loc, creates a new Net::SSLeay::X509_EXTENSION object, sets the pointer value of the new object to the return value of the native function, sets no_free flag of the new object to 1, creates a reference from the new object to the instance, and returns the new object.

Exceptions:

If X509_get_ext failed, an exception is thrown with eval_error_id set to the basic type ID of Net::SSLeay::Error class.

DESTROY

method DESTROY : void ();

Calls native X509_free function given the pointer value of the instance if no_free flag of the instance is not a true value.

FAQ

How to create a new Net::SSLeay::X509 object?

A way is reading PEM file by calling native Net::SSLeay::PEM#read_bio_X509 method.

See Also

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License