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.

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.

get_ext_d2i

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

Calls native X509_get_ext_d2i function given the pointer value of the instance, $nid, $crit_ref, $idx_ref.

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.

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