view release on metacpan or search on metacpan
lib/Crypt/OpenSSL3.xs view on Meta::CPAN
#define EVP_MAC_CTX_get_name EVP_MAC_CTX_get0_name
#define EVP_KDF_get_name EVP_KDF_get0_name
#define EVP_KDF_get_description EVP_KDF_get0_description
#define EVP_KDF_CTX_get_name EVP_KDF_CTX_get0_name
#define EVP_KDF_CTX_kdf(ctx) (EVP_KDF*)EVP_KDF_CTX_kdf(ctx)
#define EVP_SIGNATURE_get_name EVP_SIGNATURE_get0_name
#define EVP_SIGNATURE_get_description EVP_SIGNATURE_get0_description
#define EVP_PKEY_read_pem_private_key PEM_read_bio_PrivateKey_ex
#define EVP_PKEY_write_pem_private_key PEM_write_bio_PrivateKey_ex
#define EVP_PKEY_read_pem_public_key PEM_read_bio_PUBKEY_ex
#define EVP_PKEY_write_pem_public_key PEM_write_bio_PUBKEY_ex
#define EVP_PKEY_read_der_private_key d2i_PrivateKey_ex_bio
#define EVP_PKEY_write_der_private_key i2d_PrivateKey_bio
#if !OPENSSL_VERSION_PREREQ(3, 2)
#define d2i_PUBKEY_ex_bio(bio, ptr, lib, propq) d2i_PUBKEY_bio(bio, ptr)
#endif
#define EVP_PKEY_read_der_public_key d2i_PUBKEY_ex_bio
#define EVP_PKEY_write_der_public_key i2d_PUBKEY_bio
#define EVP_PKEY_new_raw_private_key EVP_PKEY_new_raw_private_key_ex
#define EVP_PKEY_new_raw_public_key EVP_PKEY_new_raw_public_key_ex
#define EVP_PKEY_get_description EVP_PKEY_get0_description
#define EVP_PKEY_get_type_name EVP_PKEY_get0_type_name
#define EVP_PKEY_get_encoded_public_key EVP_PKEY_get1_encoded_public_key
#define EVP_PKEY_set_encoded_public_key EVP_PKEY_set1_encoded_public_key
#define EVP_PKEY_encrypt_init EVP_PKEY_encrypt_init_ex
#define EVP_PKEY_decrypt_init EVP_PKEY_decrypt_init_ex
#define EVP_PKEY_derive_init EVP_PKEY_derive_init_ex
#define EVP_PKEY_derive_set_peer EVP_PKEY_derive_set_peer_ex
#define EVP_PKEY_CTX_get_pkey EVP_PKEY_CTX_get0_pkey
lib/Crypt/OpenSSL3.xs view on Meta::CPAN
bool X509_check_host(Crypt::OpenSSL3::X509 cert, const char *name, size_t length(name), unsigned int flags, OUTLIST char *peername)
bool X509_check_email(Crypt::OpenSSL3::X509 cert, const char *address, size_t length(address), unsigned int flags)
bool X509_check_ip(Crypt::OpenSSL3::X509 cert, const unsigned char *address, size_t length(address), unsigned int flags)
bool X509_check_ip_asc(Crypt::OpenSSL3::X509 cert, const char *address, unsigned int flags)
bool X509_check_issued(Crypt::OpenSSL3::X509 issuer, Crypt::OpenSSL3::X509 subject)
bool X509_check_private_key(Crypt::OpenSSL3::X509 cert, Crypt::OpenSSL3::PKey pkey)
int X509_cmp(Crypt::OpenSSL3::X509 a, Crypt::OpenSSL3::X509 b)
int X509_issuer_and_serial_cmp(Crypt::OpenSSL3::X509 a, Crypt::OpenSSL3::X509 b)
int X509_issuer_name_cmp(Crypt::OpenSSL3::X509 a, Crypt::OpenSSL3::X509 b)
int X509_subject_name_cmp(Crypt::OpenSSL3::X509 a, Crypt::OpenSSL3::X509 b)
long X509_get_pathlen(Crypt::OpenSSL3::X509 x)
lib/Crypt/OpenSSL3.xs view on Meta::CPAN
CSTACK_TO_STACK(X509_EXTENSION, exts);
bool X509_REQ_add_extensions(Crypt::OpenSSL3::X509::Request req, STACK_OF(X509_EXTENSION) *exts)
POSTCALL:
sk_X509_EXTENSION_free(exts);
bool X509_REQ_add_extensions_nid(Crypt::OpenSSL3::X509::Request req, STACK_OF(X509_EXTENSION) *exts, Crypt::OpenSSL3::NID nid)
POSTCALL:
sk_X509_EXTENSION_free(exts);
bool X509_REQ_check_private_key(Crypt::OpenSSL3::X509::Request cert, Crypt::OpenSSL3::PKey pkey)
NO_OUTPUT Bool X509_REQ_digest(Crypt::OpenSSL3::X509::Request data, Crypt::OpenSSL3::MD type, OUTLIST SV* digest)
INIT:
unsigned int output_length = EVP_MD_size(type);
unsigned char* ptr = make_buffer(&digest, output_length);
C_ARGS: data, type, ptr, &output_length
POSTCALL:
if (RETVAL)
set_buffer_length(digest, output_length);
lib/Crypt/OpenSSL3.xs view on Meta::CPAN
long SSL_CTX_clear_extra_chain_certs(Crypt::OpenSSL3::SSL::Context ctx)
bool SSL_CTX_use_PrivateKey(Crypt::OpenSSL3::SSL::Context ctx, Crypt::OpenSSL3::PKey pkey)
bool SSL_CTX_use_PrivateKey_ASN1(Crypt::OpenSSL3::SSL::Context ctx, int pk, const unsigned char *d, long length(d))
C_ARGS: pk, ctx, d, XSauto_length_of_d
bool SSL_CTX_use_PrivateKey_file(Crypt::OpenSSL3::SSL::Context ctx, const char *file, int type)
bool SSL_CTX_check_private_key(Crypt::OpenSSL3::SSL::Context ctx)
void SSL_CTX_set_verify(Crypt::OpenSSL3::SSL::Context ctx, int mode)
C_ARGS: ctx, mode, NULL
void SSL_CTX_set_verify_depth(Crypt::OpenSSL3::SSL::Context ctx, int depth)
void SSL_CTX_set_post_handshake_auth(Crypt::OpenSSL3::SSL::Context ctx, int val)
bool SSL_CTX_set_cipher_list(Crypt::OpenSSL3::SSL::Context ctx, const char *str)
lib/Crypt/OpenSSL3.xs view on Meta::CPAN
bool SSL_use_certificate_chain_file(Crypt::OpenSSL3::SSL ssl, const char *file)
bool SSL_use_PrivateKey(Crypt::OpenSSL3::SSL ssl, Crypt::OpenSSL3::PKey pkey)
bool SSL_use_PrivateKey_ASN1(Crypt::OpenSSL3::SSL ssl, int pk, const unsigned char *d, long length(d))
C_ARGS: pk, ssl, d, XSauto_length_of_d
bool SSL_use_PrivateKey_file(Crypt::OpenSSL3::SSL ssl, const char *file, int type)
bool SSL_check_private_key(Crypt::OpenSSL3::SSL ssl)
void SSL_set_verify(Crypt::OpenSSL3::SSL ssl, int mode)
C_ARGS: ssl, mode, NULL
void SSL_set_verify_depth(Crypt::OpenSSL3::SSL ssl, int depth)
Crypt::OpenSSL3::X509::VerifyResult SSL_get_verify_result(Crypt::OpenSSL3::SSL ssl);
void SSL_set_post_handshake_auth(Crypt::OpenSSL3::SSL ssl, int val)
lib/Crypt/OpenSSL3.xs view on Meta::CPAN
{
HV* stash = gv_stashpvs("Crypt::OpenSSL3::PKey", GV_ADD | GV_ADDMULTI);
CONSTANT2(EVP_PKEY_, KEY_PARAMETERS);
CONSTANT2(EVP_PKEY_, PUBLIC_KEY);
CONSTANT2(EVP_PKEY_, KEYPAIR);
}
Crypt::OpenSSL3::PKey EVP_PKEY_new(classname)
C_ARGS:
Crypt::OpenSSL3::PKey EVP_PKEY_new_raw_private_key(classname, const char *keytype, const unsigned char *key, size_t length(key), const char *propq = "")
C_ARGS: NULL, keytype, propq, key, XSauto_length_of_key
POSTCALL:
if (RETVAL == NULL)
XSRETURN_UNDEF;
Crypt::OpenSSL3::PKey EVP_PKEY_new_raw_public_key(classname, const char *keytype, const unsigned char *key, size_t length(key), const char *propq = "")
C_ARGS: NULL, keytype, propq, key, XSauto_length_of_key
POSTCALL:
if (RETVAL == NULL)
XSRETURN_UNDEF;
Crypt::OpenSSL3::PKey EVP_PKEY_dup(Crypt::OpenSSL3::PKey ctx)
bool EVP_PKEY_eq(Crypt::OpenSSL3::PKey a, Crypt::OpenSSL3::PKey b)
bool EVP_PKEY_parameters_eq(Crypt::OpenSSL3::PKey a, Crypt::OpenSSL3::PKey b)
NO_OUTPUT void EVP_PKEY_get_raw_private_key(Crypt::OpenSSL3::PKey pkey, OUTLIST SV* key)
CODE:
size_t length;
int result = EVP_PKEY_get_raw_private_key(pkey, NULL, &length);
if (!result)
XSRETURN_UNDEF;
unsigned char* ptr = make_buffer(&key, length);
result = EVP_PKEY_get_raw_private_key(pkey, ptr, &length);
if (result)
set_buffer_length(key, length);
NO_OUTPUT void EVP_PKEY_get_raw_public_key(Crypt::OpenSSL3::PKey pkey, OUTLIST SV* key)
CODE:
size_t length;
int result = EVP_PKEY_get_raw_public_key(pkey, NULL, &length);
if (!result)
XSRETURN_UNDEF;
unsigned char* ptr = make_buffer(&key, length);
result = EVP_PKEY_get_raw_public_key(pkey, ptr, &length);
if (result)
set_buffer_length(key, length);
Crypt::OpenSSL3::PKey EVP_PKEY_read_pem_private_key(Crypt::OpenSSL3::BIO bio, SV* password_cb = undef, const char* propq = "")
C_ARGS: bio, NULL, NULL, NULL, NULL, propq
POSTCALL:
if (!RETVAL)
XSRETURN_UNDEF;
bool EVP_PKEY_write_pem_private_key(Crypt::OpenSSL3::PKey pkey, Crypt::OpenSSL3::BIO bio, SV* cipher_sv = undef, SV* key = undef, const char* propq = "")
INIT:
const EVP_CIPHER* cipher = SvOK(cipher_sv) ? get_EVP_CIPHER(aTHX_ cipher_sv) : NULL;
STRLEN klen = 0;
const unsigned char* kstr = NULL;
if (SvOK(key))
kstr = (unsigned char*)SvPV(key, klen);
C_ARGS: bio, pkey, cipher, kstr, klen, NULL, NULL, NULL, propq
Crypt::OpenSSL3::PKey EVP_PKEY_read_pem_public_key(Crypt::OpenSSL3::BIO bio, const char* propq = "")
C_ARGS: bio, NULL, NULL, NULL, NULL, propq
lib/Crypt/OpenSSL3.xs view on Meta::CPAN
bool EVP_PKEY_write_pem_public_key(Crypt::OpenSSL3::PKey pkey, Crypt::OpenSSL3::BIO bio, const char* propq = "")
C_ARGS: bio, pkey, NULL, propq
Crypt::OpenSSL3::PKey EVP_PKEY_read_der_public_key(class, Crypt::OpenSSL3::BIO bio, const char* propq = NULL)
C_ARGS: bio, NULL, NULL, propq
POSTCALL:
if (!RETVAL)
XSRETURN_UNDEF;
Crypt::OpenSSL3::PKey EVP_PKEY_read_der_private_key(class, Crypt::OpenSSL3::BIO bio, const char* propq = NULL)
C_ARGS: bio, NULL, NULL, propq
POSTCALL:
if (!RETVAL)
XSRETURN_UNDEF;
bool EVP_PKEY_write_der_public_key(Crypt::OpenSSL3::PKey a, Crypt::OpenSSL3::BIO bio)
INTERFACE: EVP_PKEY_write_der_public_key EVP_PKEY_write_der_private_key
C_ARGS: bio, a
Crypt::OpenSSL3::PKey EVP_PKEY_decode_der_public_key(class, ASN1_DECODER* buffer)
CODE:
RETVAL = d2i_PUBKEY(NULL, &buffer->ptr, buffer->end - buffer->ptr);
if (!RETVAL)
XSRETURN_UNDEF;
OUTPUT: RETVAL
SV* EVP_PKEY_encode_der_public_key(Crypt::OpenSSL3::PKey x)
CODE:
int length = i2d_PUBKEY(x, NULL);
if (length > 0) {
unsigned char* ptr = make_buffer(&RETVAL, length);
i2d_PUBKEY(x, &ptr);
set_buffer_length(RETVAL, length);
} else
RETVAL = &PL_sv_undef;
OUTPUT: RETVAL
Crypt::OpenSSL3::PKey EVP_PKEY_decode_der_private_key(class, ASN1_DECODER* buffer)
CODE:
RETVAL = d2i_AutoPrivateKey(NULL, &buffer->ptr, buffer->end - buffer->ptr);
if (!RETVAL)
XSRETURN_UNDEF;
OUTPUT: RETVAL
SV* EVP_PKEY_encode_der_private_key(Crypt::OpenSSL3::PKey x)
CODE:
int length = i2d_PrivateKey(x, NULL);
if (length > 0) {
unsigned char* ptr = make_buffer(&RETVAL, length);
i2d_PrivateKey(x, &ptr);
set_buffer_length(RETVAL, length);
} else
RETVAL = &PL_sv_undef;
OUTPUT: RETVAL
lib/Crypt/OpenSSL3/PKey.pm view on Meta::CPAN
Crypt::OpenSSL3::PKey - An asymmetric key
=head1 VERSION
version 0.010
=head1 SYNOPSIS
my $file = Crypt::OpenSSL3::BIO->new_file('priv.key', 'r');
my $key = Crypt::OpenSSL3::Pkey->read_pem_private_key($file);
my $ctx = Crypt::OpenSSL3::PKey::Context->new($key);
$ctx->sign_init;
my $signature = $ctx->sign($data);
=head1 DESCRIPTION
A C<PKey> can be any kind of asymmetric key. This is a fat interface: no single key type supports all possible operations, and most operations aren't supported by all key types. At its core the operations are:
=over 4
lib/Crypt/OpenSSL3/PKey.pm view on Meta::CPAN
=item * key generation
=item * parameter generation
=back
=head1 METHODS
=head2 new
=head2 new_raw_private_key
=head2 new_raw_public_key
=head2 read_der_private_key
=head2 read_der_public_key
=head2 read_pem_private_key
=head2 read_pem_public_key
=head2 write_der_private_key
=head2 write_der_public_key
=head2 write_pem_private_key
=head2 write_pem_public_key
=head2 decode_der_public_key
=head2 decode_der_private_key
=head2 encode_der_public_key
=head2 encode_der_private_key
=head2 can_sign
=head2 digestsign_supports_digest
=head2 dup
=head2 eq
=head2 get_base_id
lib/Crypt/OpenSSL3/PKey.pm view on Meta::CPAN
=head2 get_group_name
=head2 get_id
=head2 get_int_param
=head2 get_octet_string_param
=head2 get_param
=head2 get_raw_private_key
=head2 get_raw_public_key
=head2 get_security_bits
=head2 get_size
=head2 get_size_t_param
=head2 get_type_name
lib/Crypt/OpenSSL3/SSL.pm view on Meta::CPAN
=head2 new
=head2 accept
=head2 accept_connection
=head2 accept_stream
=head2 add_client_CA
=head2 check_private_key
=head2 clear
=head2 clear_mode
=head2 clear_options
=head2 client_version
=head2 connect
lib/Crypt/OpenSSL3/SSL/Context.pm view on Meta::CPAN
=head1 METHODS
=head2 new
=head2 add_client_CA
=head2 add_extra_chain_cert
=head2 add_session
=head2 check_private_key
=head2 clear_extra_chain_certs
=head2 clear_mode
=head2 clear_options
=head2 get_cert_store
=head2 get_domain_flags
lib/Crypt/OpenSSL3/X509.pm view on Meta::CPAN
=head2 check_email
=head2 check_host
=head2 check_ip
=head2 check_ip_asc
=head2 check_issued
=head2 check_private_key
=head2 cmp
=head2 decode_der
=head2 delete_ext
=head2 digest
=head2 digest_sig
lib/Crypt/OpenSSL3/X509/Request.pm view on Meta::CPAN
=head2 add_attr_by_NID
=head2 add_attr_by_OBJ
=head2 add_attr_by_txt
=head2 add_extensions
=head2 add_extensions_nid
=head2 check_private_key
=head2 decode_der
=head2 delete_attr
=head2 digest
=head2 dup
=head2 encode_der