Name

SPVM::Net::SSLeay::X509_STORE_CTX - X509_STORE_CTX Data Structure in OpenSSL

Description

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

Usage

use Net::SSLeay::X509_STORE_CTX;

Class Methods

method get1_issuer : int ($issuer_ref : Net::SSLeay::X509, $ctx : Net::SSLeay::X509_STORE_CTX, $x : Net::SSLeay::X509);

Calls native X509_STORE_CTX_get1_issuer function given $issuer_ref, $ctx, $x. , sets $issuer_ref at index 0 to the new object, and returns the return value of the native function.

Exceptions:

The output array of the Net::SSLeay::X509 $issuer_ref must be defined. Otherwise an exception is thrown.

The length of $issuer_ref must be 1. Otherwise an exception is thrown.

The Net::SSLeay::X509_STORE_CTX object $ctx must be defined. Otherwise an exception is thrown.

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

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

Instance Methods

set_error

method set_error : void ($s : int);

Calls native X509_STORE_CTX_set_error function given the pointer value of the instance, $s.

get_error

method get_error : int ();

Calls native X509_STORE_CTX_get_error function, and returns its return value.

get_error_depth

method get_error_depth : int ();

Calls native X509_STORE_CTX_get_error_depth function, and returns its return value.

get_current_cert

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

Calls native X509_STORE_CTX_get_current_cert function.

If the return value is NULL, returns undef.

Otherwise, creates a new new Net::SSLeay::X509 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, returns the new object.

Init

method Init : int ($trust_store : Net::SSLeay::X509_STORE, $target : Net::SSLeay::X509, $untrusted_array : Net::SSLeay::X509[]);

Calls native X509_STORE_CTX_init function given the pointer value of $trust_store, the pointer value of $target, the value that converts $untrusted_array to STACK_OF(X509) type, and returns its return value.

Exceptions:

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

The X509 array $untrusted_array must be defined. Otherwise an exception is thrown.

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

Copyright & License

Copyright (c) 2024 Yuki Kimoto

MIT License