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 $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.

pubkey_digest

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

Calls native X509_pubkey_digest function given $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.

get_ext_d2i

method get_ext_d2i : void ($nid : int, $crit_ref : int*, $idx_ref : int*);

Calls native X509_get_ext_d2i function given $nid, $crit_ref, $idx_ref.

DESTROY

method DESTROY : void ();

Frees native X509 object by calling native X509_free function 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