view release on metacpan or search on metacpan
lib/APNS/Agent.pm view on Meta::CPAN
use Class::Accessor::Lite::Lazy 0.03 (
new => 1,
ro => [qw/
certificate
private_key
sandbox
debug_port
/],
ro_lazy => {
on_error_response => sub {
lib/APNS/Agent.pm view on Meta::CPAN
sub _build_apns {
my $self = shift;
AnyEvent::APNS->new(
certificate => $self->certificate,
private_key => $self->private_key,
sandbox => $self->sandbox,
on_error => sub {
my ($handle, $fatal, $message) = @_;
my $t; $t = AnyEvent->timer(
lib/APNS/Agent.pm view on Meta::CPAN
=head1 SYNOPSIS
use APNS::Agent;
my $agent = APNS::Agent->new(
certificate => '/path/to/certificate',
private_key => '/path/to/private_key',
);
$agent->run;
=head1 DESCRIPTION
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AWS/S3/Signer/V4.pm view on Meta::CPAN
=head1 METHODS
=over 4
=item $signer = AWS::S3::Signer::V4->new(-access_key => $account_id,-secret_key => $private_key);
Create a signing object using your AWS account ID and secret key. You
may also use the temporary security tokens received from Amazon's STS
service, either by passing the access and secret keys derived from the
token, or by passing a VM::EC2::Security::Token produced by the
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AWS/Signature4.pm view on Meta::CPAN
=head1 METHODS
=over 4
=item $signer = AWS::Signature4->new(-access_key => $account_id,-secret_key => $private_key);
Create a signing object using your AWS account ID and secret key. You
may also use the temporary security tokens received from Amazon's STS
service, either by passing the access and secret keys derived from the
token, or by passing a VM::EC2::Security::Token produced by the
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/JWT.pm view on Meta::CPAN
sub sign_rsa {
my $self = shift;
my ($algo, $key, $msg) = @_;
$algo =~ s/\D+//;
my $private_key = Crypt::OpenSSL::RSA->new_private_key($key);
$private_key->can("use_sha${algo}_hash")->($private_key);
$private_key->sign($msg);
}
sub verify_rsa {
my $self = shift;
my ($algo, $key, $signing_input, $signature) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
corpus/vcpkg/r2/installed/vcpkg/info/openssl-windows_1.1.1d-1_x64-windows.list view on Meta::CPAN
x64-windows/debug/html/man3/EC_KEY_dup.html
x64-windows/debug/html/man3/EC_KEY_free.html
x64-windows/debug/html/man3/EC_KEY_generate_key.html
x64-windows/debug/html/man3/EC_KEY_get0_engine.html
x64-windows/debug/html/man3/EC_KEY_get0_group.html
x64-windows/debug/html/man3/EC_KEY_get0_private_key.html
x64-windows/debug/html/man3/EC_KEY_get0_public_key.html
x64-windows/debug/html/man3/EC_KEY_get_conv_form.html
x64-windows/debug/html/man3/EC_KEY_get_enc_flags.html
x64-windows/debug/html/man3/EC_KEY_get_ex_data.html
x64-windows/debug/html/man3/EC_KEY_get_ex_new_index.html
corpus/vcpkg/r2/installed/vcpkg/info/openssl-windows_1.1.1d-1_x64-windows.list view on Meta::CPAN
x64-windows/debug/html/man3/EC_KEY_set_enc_flags.html
x64-windows/debug/html/man3/EC_KEY_set_ex_data.html
x64-windows/debug/html/man3/EC_KEY_set_flags.html
x64-windows/debug/html/man3/EC_KEY_set_group.html
x64-windows/debug/html/man3/EC_KEY_set_method.html
x64-windows/debug/html/man3/EC_KEY_set_private_key.html
x64-windows/debug/html/man3/EC_KEY_set_public_key.html
x64-windows/debug/html/man3/EC_KEY_set_public_key_affine_coordinates.html
x64-windows/debug/html/man3/EC_KEY_up_ref.html
x64-windows/debug/html/man3/EC_METHOD_get_field_type.html
x64-windows/debug/html/man3/EC_POINT_add.html
corpus/vcpkg/r2/installed/vcpkg/info/openssl-windows_1.1.1d-1_x64-windows.list view on Meta::CPAN
x64-windows/debug/html/man3/ENGINE_get_next.html
x64-windows/debug/html/man3/ENGINE_get_prev.html
x64-windows/debug/html/man3/ENGINE_get_table_flags.html
x64-windows/debug/html/man3/ENGINE_init.html
x64-windows/debug/html/man3/ENGINE_load_builtin_engines.html
x64-windows/debug/html/man3/ENGINE_load_private_key.html
x64-windows/debug/html/man3/ENGINE_load_public_key.html
x64-windows/debug/html/man3/ENGINE_new.html
x64-windows/debug/html/man3/ENGINE_register_DH.html
x64-windows/debug/html/man3/ENGINE_register_DSA.html
x64-windows/debug/html/man3/ENGINE_register_RAND.html
corpus/vcpkg/r2/installed/vcpkg/info/openssl-windows_1.1.1d-1_x64-windows.list view on Meta::CPAN
x64-windows/debug/html/man3/EVP_PKEY_get1_DH.html
x64-windows/debug/html/man3/EVP_PKEY_get1_DSA.html
x64-windows/debug/html/man3/EVP_PKEY_get1_EC_KEY.html
x64-windows/debug/html/man3/EVP_PKEY_get1_RSA.html
x64-windows/debug/html/man3/EVP_PKEY_get_default_digest_nid.html
x64-windows/debug/html/man3/EVP_PKEY_get_raw_private_key.html
x64-windows/debug/html/man3/EVP_PKEY_get_raw_public_key.html
x64-windows/debug/html/man3/EVP_PKEY_id.html
x64-windows/debug/html/man3/EVP_PKEY_keygen.html
x64-windows/debug/html/man3/EVP_PKEY_keygen_init.html
x64-windows/debug/html/man3/EVP_PKEY_meth_add0.html
corpus/vcpkg/r2/installed/vcpkg/info/openssl-windows_1.1.1d-1_x64-windows.list view on Meta::CPAN
x64-windows/debug/html/man3/EVP_PKEY_meth_set_verifyctx.html
x64-windows/debug/html/man3/EVP_PKEY_missing_parameters.html
x64-windows/debug/html/man3/EVP_PKEY_new.html
x64-windows/debug/html/man3/EVP_PKEY_new_CMAC_key.html
x64-windows/debug/html/man3/EVP_PKEY_new_mac_key.html
x64-windows/debug/html/man3/EVP_PKEY_new_raw_private_key.html
x64-windows/debug/html/man3/EVP_PKEY_new_raw_public_key.html
x64-windows/debug/html/man3/EVP_PKEY_param_check.html
x64-windows/debug/html/man3/EVP_PKEY_paramgen.html
x64-windows/debug/html/man3/EVP_PKEY_paramgen_init.html
x64-windows/debug/html/man3/EVP_PKEY_print_params.html
corpus/vcpkg/r2/installed/vcpkg/info/openssl-windows_1.1.1d-1_x64-windows.list view on Meta::CPAN
x64-windows/debug/html/man3/SSL_CTX_add_extra_chain_cert.html
x64-windows/debug/html/man3/SSL_CTX_add_server_custom_ext.html
x64-windows/debug/html/man3/SSL_CTX_add_session.html
x64-windows/debug/html/man3/SSL_CTX_build_cert_chain.html
x64-windows/debug/html/man3/SSL_CTX_callback_ctrl.html
x64-windows/debug/html/man3/SSL_CTX_check_private_key.html
x64-windows/debug/html/man3/SSL_CTX_clear_chain_certs.html
x64-windows/debug/html/man3/SSL_CTX_clear_extra_chain_certs.html
x64-windows/debug/html/man3/SSL_CTX_clear_mode.html
x64-windows/debug/html/man3/SSL_CTX_clear_options.html
x64-windows/debug/html/man3/SSL_CTX_config.html
corpus/vcpkg/r2/installed/vcpkg/info/openssl-windows_1.1.1d-1_x64-windows.list view on Meta::CPAN
x64-windows/debug/html/man3/SSL_allow_early_data_cb_fn.html
x64-windows/debug/html/man3/SSL_build_cert_chain.html
x64-windows/debug/html/man3/SSL_bytes_to_cipher_list.html
x64-windows/debug/html/man3/SSL_callback_ctrl.html
x64-windows/debug/html/man3/SSL_check_chain.html
x64-windows/debug/html/man3/SSL_check_private_key.html
x64-windows/debug/html/man3/SSL_clear.html
x64-windows/debug/html/man3/SSL_clear_chain_certs.html
x64-windows/debug/html/man3/SSL_clear_mode.html
x64-windows/debug/html/man3/SSL_clear_options.html
x64-windows/debug/html/man3/SSL_client_hello_cb_fn.html
corpus/vcpkg/r2/installed/vcpkg/info/openssl-windows_1.1.1d-1_x64-windows.list view on Meta::CPAN
x64-windows/debug/html/man3/X509_PUBKEY_new.html
x64-windows/debug/html/man3/X509_PUBKEY_set.html
x64-windows/debug/html/man3/X509_PUBKEY_set0_param.html
x64-windows/debug/html/man3/X509_REQ_INFO_free.html
x64-windows/debug/html/man3/X509_REQ_INFO_new.html
x64-windows/debug/html/man3/X509_REQ_check_private_key.html
x64-windows/debug/html/man3/X509_REQ_digest.html
x64-windows/debug/html/man3/X509_REQ_dup.html
x64-windows/debug/html/man3/X509_REQ_free.html
x64-windows/debug/html/man3/X509_REQ_get0_pubkey.html
x64-windows/debug/html/man3/X509_REQ_get0_signature.html
corpus/vcpkg/r2/installed/vcpkg/info/openssl-windows_1.1.1d-1_x64-windows.list view on Meta::CPAN
x64-windows/debug/html/man3/X509_check_email.html
x64-windows/debug/html/man3/X509_check_host.html
x64-windows/debug/html/man3/X509_check_ip.html
x64-windows/debug/html/man3/X509_check_ip_asc.html
x64-windows/debug/html/man3/X509_check_issued.html
x64-windows/debug/html/man3/X509_check_private_key.html
x64-windows/debug/html/man3/X509_cmp.html
x64-windows/debug/html/man3/X509_cmp_current_time.html
x64-windows/debug/html/man3/X509_cmp_time.html
x64-windows/debug/html/man3/X509_delete_ext.html
x64-windows/debug/html/man3/X509_digest.html
corpus/vcpkg/r2/installed/vcpkg/info/openssl-windows_1.1.1d-1_x64-windows.list view on Meta::CPAN
x64-windows/html/man3/EC_KEY_dup.html
x64-windows/html/man3/EC_KEY_free.html
x64-windows/html/man3/EC_KEY_generate_key.html
x64-windows/html/man3/EC_KEY_get0_engine.html
x64-windows/html/man3/EC_KEY_get0_group.html
x64-windows/html/man3/EC_KEY_get0_private_key.html
x64-windows/html/man3/EC_KEY_get0_public_key.html
x64-windows/html/man3/EC_KEY_get_conv_form.html
x64-windows/html/man3/EC_KEY_get_enc_flags.html
x64-windows/html/man3/EC_KEY_get_ex_data.html
x64-windows/html/man3/EC_KEY_get_ex_new_index.html
corpus/vcpkg/r2/installed/vcpkg/info/openssl-windows_1.1.1d-1_x64-windows.list view on Meta::CPAN
x64-windows/html/man3/EC_KEY_set_enc_flags.html
x64-windows/html/man3/EC_KEY_set_ex_data.html
x64-windows/html/man3/EC_KEY_set_flags.html
x64-windows/html/man3/EC_KEY_set_group.html
x64-windows/html/man3/EC_KEY_set_method.html
x64-windows/html/man3/EC_KEY_set_private_key.html
x64-windows/html/man3/EC_KEY_set_public_key.html
x64-windows/html/man3/EC_KEY_set_public_key_affine_coordinates.html
x64-windows/html/man3/EC_KEY_up_ref.html
x64-windows/html/man3/EC_METHOD_get_field_type.html
x64-windows/html/man3/EC_POINT_add.html
corpus/vcpkg/r2/installed/vcpkg/info/openssl-windows_1.1.1d-1_x64-windows.list view on Meta::CPAN
x64-windows/html/man3/ENGINE_get_next.html
x64-windows/html/man3/ENGINE_get_prev.html
x64-windows/html/man3/ENGINE_get_table_flags.html
x64-windows/html/man3/ENGINE_init.html
x64-windows/html/man3/ENGINE_load_builtin_engines.html
x64-windows/html/man3/ENGINE_load_private_key.html
x64-windows/html/man3/ENGINE_load_public_key.html
x64-windows/html/man3/ENGINE_new.html
x64-windows/html/man3/ENGINE_register_DH.html
x64-windows/html/man3/ENGINE_register_DSA.html
x64-windows/html/man3/ENGINE_register_RAND.html
corpus/vcpkg/r2/installed/vcpkg/info/openssl-windows_1.1.1d-1_x64-windows.list view on Meta::CPAN
x64-windows/html/man3/EVP_PKEY_get1_DH.html
x64-windows/html/man3/EVP_PKEY_get1_DSA.html
x64-windows/html/man3/EVP_PKEY_get1_EC_KEY.html
x64-windows/html/man3/EVP_PKEY_get1_RSA.html
x64-windows/html/man3/EVP_PKEY_get_default_digest_nid.html
x64-windows/html/man3/EVP_PKEY_get_raw_private_key.html
x64-windows/html/man3/EVP_PKEY_get_raw_public_key.html
x64-windows/html/man3/EVP_PKEY_id.html
x64-windows/html/man3/EVP_PKEY_keygen.html
x64-windows/html/man3/EVP_PKEY_keygen_init.html
x64-windows/html/man3/EVP_PKEY_meth_add0.html
corpus/vcpkg/r2/installed/vcpkg/info/openssl-windows_1.1.1d-1_x64-windows.list view on Meta::CPAN
x64-windows/html/man3/EVP_PKEY_meth_set_verifyctx.html
x64-windows/html/man3/EVP_PKEY_missing_parameters.html
x64-windows/html/man3/EVP_PKEY_new.html
x64-windows/html/man3/EVP_PKEY_new_CMAC_key.html
x64-windows/html/man3/EVP_PKEY_new_mac_key.html
x64-windows/html/man3/EVP_PKEY_new_raw_private_key.html
x64-windows/html/man3/EVP_PKEY_new_raw_public_key.html
x64-windows/html/man3/EVP_PKEY_param_check.html
x64-windows/html/man3/EVP_PKEY_paramgen.html
x64-windows/html/man3/EVP_PKEY_paramgen_init.html
x64-windows/html/man3/EVP_PKEY_print_params.html
corpus/vcpkg/r2/installed/vcpkg/info/openssl-windows_1.1.1d-1_x64-windows.list view on Meta::CPAN
x64-windows/html/man3/SSL_CTX_add_extra_chain_cert.html
x64-windows/html/man3/SSL_CTX_add_server_custom_ext.html
x64-windows/html/man3/SSL_CTX_add_session.html
x64-windows/html/man3/SSL_CTX_build_cert_chain.html
x64-windows/html/man3/SSL_CTX_callback_ctrl.html
x64-windows/html/man3/SSL_CTX_check_private_key.html
x64-windows/html/man3/SSL_CTX_clear_chain_certs.html
x64-windows/html/man3/SSL_CTX_clear_extra_chain_certs.html
x64-windows/html/man3/SSL_CTX_clear_mode.html
x64-windows/html/man3/SSL_CTX_clear_options.html
x64-windows/html/man3/SSL_CTX_config.html
corpus/vcpkg/r2/installed/vcpkg/info/openssl-windows_1.1.1d-1_x64-windows.list view on Meta::CPAN
x64-windows/html/man3/SSL_allow_early_data_cb_fn.html
x64-windows/html/man3/SSL_build_cert_chain.html
x64-windows/html/man3/SSL_bytes_to_cipher_list.html
x64-windows/html/man3/SSL_callback_ctrl.html
x64-windows/html/man3/SSL_check_chain.html
x64-windows/html/man3/SSL_check_private_key.html
x64-windows/html/man3/SSL_clear.html
x64-windows/html/man3/SSL_clear_chain_certs.html
x64-windows/html/man3/SSL_clear_mode.html
x64-windows/html/man3/SSL_clear_options.html
x64-windows/html/man3/SSL_client_hello_cb_fn.html
corpus/vcpkg/r2/installed/vcpkg/info/openssl-windows_1.1.1d-1_x64-windows.list view on Meta::CPAN
x64-windows/html/man3/X509_PUBKEY_new.html
x64-windows/html/man3/X509_PUBKEY_set.html
x64-windows/html/man3/X509_PUBKEY_set0_param.html
x64-windows/html/man3/X509_REQ_INFO_free.html
x64-windows/html/man3/X509_REQ_INFO_new.html
x64-windows/html/man3/X509_REQ_check_private_key.html
x64-windows/html/man3/X509_REQ_digest.html
x64-windows/html/man3/X509_REQ_dup.html
x64-windows/html/man3/X509_REQ_free.html
x64-windows/html/man3/X509_REQ_get0_pubkey.html
x64-windows/html/man3/X509_REQ_get0_signature.html
corpus/vcpkg/r2/installed/vcpkg/info/openssl-windows_1.1.1d-1_x64-windows.list view on Meta::CPAN
x64-windows/html/man3/X509_check_email.html
x64-windows/html/man3/X509_check_host.html
x64-windows/html/man3/X509_check_ip.html
x64-windows/html/man3/X509_check_ip_asc.html
x64-windows/html/man3/X509_check_issued.html
x64-windows/html/man3/X509_check_private_key.html
x64-windows/html/man3/X509_cmp.html
x64-windows/html/man3/X509_cmp_current_time.html
x64-windows/html/man3/X509_cmp_time.html
x64-windows/html/man3/X509_delete_ext.html
x64-windows/html/man3/X509_digest.html
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypt/OpenSSL/PKCS12.pm view on Meta::CPAN
my $pass = "your password";
my $pkcs12 = Crypt::OpenSSL::PKCS12->new_from_file('cert.p12');
print $pkcs12->certificate($pass);
print $pkcs12->private_key($pass);
if ($pkcs12->mac_ok($pass)) {
...
# Creating a file
lib/Crypt/OpenSSL/PKCS12.pm view on Meta::CPAN
=item * ca_certificate( [C<$pass>] )
Get the Base64 representation of the CA certificate chain.
=item * private_key( [C<$pass>] )
Get the Base64 representation of the private key.
=item * as_string( [C<$pass>] )
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/CloudFront/SignedURL.pm view on Meta::CPAN
xor => [qw(policy)],
},
policy => { isa => 'Str', },
);
has private_key_string => (
is => 'rw',
isa => 'Str',
required => 1,
trigger => sub {
$_[0]->clear_private_key;
},
);
has private_key => (
is => 'ro',
isa => 'Crypt::OpenSSL::RSA',
lazy_build => 1,
);
lib/Amazon/CloudFront/SignedURL.pm view on Meta::CPAN
is => 'rw',
isa => 'Str',
required => 1,
);
sub _build_private_key {
my $private_key;
eval { $private_key = Crypt::OpenSSL::RSA->new_private_key( $_[0]->private_key_string() ); };
if ($@) {
croak "Private Key Error: Maybe your key is invalid. ($@)";
}
$private_key->use_sha1_hash();
return $private_key;
}
sub generate {
my $self = shift;
my $args = $validator->validate(@_);
lib/Amazon/CloudFront/SignedURL.pm view on Meta::CPAN
return $encoded;
}
sub _sign {
my ( $self, $str ) = @_;
my $signature = $self->_encode_url_safe_base64( $self->private_key->sign($str) );
return $signature;
}
sub _create_url {
my ( $self, $resource, $expires, $policy, $signature ) = @_;
lib/Amazon/CloudFront/SignedURL.pm view on Meta::CPAN
=head1 SYNOPSIS
use Amazon::CloudFront::SignedURL;
my $signed_url = Amazon::CloudFront::SignedURL->new(
private_key_string => {PRIVATE_KEY},
key_pair_id => {KEY_PAIR_ID}
);
# create signed url with canned policy
$signed_url->generate( resource => {RESOURCE_PATH}, expires => {EXPIRES} );
lib/Amazon/CloudFront/SignedURL.pm view on Meta::CPAN
Arguments can be:
=over 4
=item * private_key_string
The private key strings.
=item * key_pair_id
view all matches for this distribution
view release on metacpan or search on metacpan
t/ansible-test1/ansible.cfg view on Meta::CPAN
# list any Jinja2 extensions to enable here:
#jinja2_extensions = jinja2.ext.do,jinja2.ext.i18n
# if set, always use this private key file for authentication, same as
# if passing --private-key to ansible or ansible-playbook
#private_key_file = /path/to/file
# If set, configures the path to the Vault password file as an alternative to
# specifying --vault-password-file on the command line.
#vault_password_file = /path/to/vault_password_file
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/APNS.pm view on Meta::CPAN
is => 'rw',
isa => 'Str | ScalarRef',
required => 1,
);
has private_key => (
is => 'rw',
isa => 'Str | ScalarRef',
required => 1,
);
lib/AnyEvent/APNS.pm view on Meta::CPAN
}
else {
$tls_setting->{cert_file} = $self->certificate;
}
if (ref $self->private_key) {
$tls_setting->{key} = ${ $self->private_key };
}
else {
$tls_setting->{key_file} = $self->private_key;
}
my $handle = AnyEvent::Handle->new(
fh => $fh,
on_error => sub {
lib/AnyEvent/APNS.pm view on Meta::CPAN
my $cv = AnyEvent->condvar;
my $apns; $apns = AnyEvent::APNS->new(
certificate => 'your apns certificate file',
private_key => 'your apns private key file',
sandbox => 1,
on_error => sub { # something went wrong },
on_connect => sub {
my $identifier = $apns->send( $device_token => {
aps => {
lib/AnyEvent/APNS.pm view on Meta::CPAN
Create APNS object.
my $apns = AnyEvent::APNS->new(
certificate => 'your apns certificate file',
private_key => 'your apns private key file',
sandbox => 1,
on_error => sub { # something went wrong },
);
Supported arguments are:
lib/AnyEvent/APNS.pm view on Meta::CPAN
# or
certificate => \$certificate,
Required. Either file path for certificate or scalar-ref of certificate data.
=item private_key => 'Str | ScalarRef'
private_key => '/path/to/private_key',
# or
private_key => \$private_key,
Required. Either file path for private_key or scalar-ref of private-key data.
=item sandbox => 0|1
This is a flag indicate target service is provisioning (sandbox => 1) or distribution (sandbox => 0)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/TS/AdminClient.pm view on Meta::CPAN
proxy.config.ssl.client.CA.cert.filename
proxy.config.ssl.client.CA.cert.path
proxy.config.ssl.client.cert.filename
proxy.config.ssl.client.certification_level
proxy.config.ssl.client.cert.path
proxy.config.ssl.client.private_key.filename
proxy.config.ssl.client.private_key.path
proxy.config.ssl.client.verify.server
proxy.config.ssl.cswift.lib.path
proxy.config.ssl.enabled
proxy.config.ssl.ncipher.lib.path
proxy.config.ssl.number.threads
proxy.config.ssl.server.cert_chain.filename
proxy.config.ssl.server.cert.filename
proxy.config.ssl.server.cert.path
proxy.config.ssl.server.multicert.filename
proxy.config.ssl.server_port
proxy.config.ssl.server.private_key.filename
proxy.config.ssl.server.private_key.path
proxy.config.stack_dump_enabled
proxy.config.start_script
proxy.config.stat_collector.interval
proxy.config.stat_collector.port
proxy.config.stats.config_file
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/TestSSLCA.pm view on Meta::CPAN
database = $db # database index file.
serial = serial # The current serial number
certificate = $cacert # The CA certificate
crl = $cacrl # The current CRL
private_key = $cakey # The private key
default_days = 365 # how long to certify for
default_crl_days = 365 # how long before next CRL
default_md = $dgst # which md to use.
preserve = no # keep passed DN ordering
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Acmeman.pm view on Meta::CPAN
unless ($self->{_account_key}) {
my $keyfile = $self->cf->get('account', 'key');
if (-r $keyfile) {
if (open(my $fh, '<', $keyfile)) {
local $/ = undef;
$self->{_account_key} = Crypt::OpenSSL::RSA->new_private_key(<$fh>);
close $fh;
} else {
error("can't open $keyfile for reading: $!");
}
} else {
lib/App/Acmeman.pm view on Meta::CPAN
sub acme {
my $self = shift;
unless ($self->{_acme}) {
my $acme = Net::ACME2::LetsEncrypt->new(
environment => $self->acme_host,
key => $self->account_key->get_private_key_string(),
key_id => $self->account_key_id
);
$self->{_acme} = $acme;
unless ($acme->key_id()) {
lib/App/Acmeman.pm view on Meta::CPAN
$acme->create_account(termsOfServiceAgreed => 1);
debug(3, "saving account credentials");
$self->account_key_id($acme->key_id());
my $keyfile = $self->cf->get('account', 'key');
if (open(my $fh, '>', $keyfile)) {
print $fh $self->account_key->get_private_key_string();
close $fh;
} else {
error("can't open $keyfile for writing: $!");
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/CamelPKI/CA.pm view on Meta::CPAN
$template->prepare_certificate
($self->certificate, $cert, %templateopts);
$cert->set_serial(sprintf("0x%x",
$self->{db}->next_serial("certificate")));
$cert = App::CamelPKI::Certificate->parse
($cert->sign($self->_private_key,
$template->signature_hash));
push @{$self->{signed}}, { cert => $cert, opts => \%dbopts };
return;
}
lib/App/CamelPKI/CA.pm view on Meta::CPAN
(defined($ctime) ? (-compromise_time => $ctime) : ()),
(defined($holdoid) ? (-hold_instruction => $holdoid) : ()),
);
}
return App::CamelPKI::CRL->parse($crl->sign($self->_private_key,
$opts{-signature_hash}));
}
=head2 get_certificates_issued()
lib/App/CamelPKI/CA.pm view on Meta::CPAN
=cut
sub _certificate_path { catfile(shift->{cryptdir}, "ca.crt") }
sub _key_path { catfile(shift->{cryptdir}, "ca.key") }
=head2 _private_key
Returns an instance of
L<Crypt::OpenSSL::CA/Crypt::OpenSSL::CA::PrivateKey> which modelise the
CA private key.
=cut
sub _private_key {
my ($self) = @_;
$self->{private_key} ||=
Crypt::OpenSSL::CA::PrivateKey->parse
(scalar(read_file($self->_key_path)));
}
require My::Tests::Below unless caller;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/GroupSecret.pm view on Meta::CPAN
my $filepath = '';
my $help = 0;
my $man = 0;
my $version = 0;
my $private_key = '';
# Parse options using pass_through so that we can pick out the global
# options, wherever they are in the arg list, and leave the rest to be
# parsed by each individual command.
Getopt::Long::Configure('pass_through');
GetOptionsFromArray(
\@args,
'file|f=s' => \$filepath,
'help|h|?' => \$help,
'manual|man' => \$man,
'private-key|k=s' => \$private_key,
'version|v' => \$version,
) or pod2usage(2);
Getopt::Long::Configure('default');
pod2usage(-exitval => 1, -verbose => 99, -sections => [qw(SYNOPSIS OPTIONS COMMANDS)]) if $help;
pod2usage(-verbose => 2) if $man;
return print "groupsecret ${VERSION}\n" if $version;
$self->{private_key} = $private_key if $private_key;
$self->{filepath} = $filepath if $filepath;
my %commands = (
add_key => 'add_key',
add_keys => 'add_key',
lib/App/GroupSecret.pm view on Meta::CPAN
my $self = shift;
return $self->{file} ||= App::GroupSecret::File->new($self->filepath);
}
sub private_key {
shift->{private_key} ||= $ENV{GROUPSECRET_PRIVATE_KEY} || "$ENV{HOME}/.ssh/id_rsa";
}
sub _action_print_secret {
my $self = shift;
lib/App/GroupSecret.pm view on Meta::CPAN
unless -e $filepath && !-d $filepath;
die "No secret in keyfile '$filepath' exists -- use the \`set-secret' command to set one.\n"
if !$file->secret;
if ($decrypt) {
my $private_key = $self->private_key;
my $secret = $file->decrypt_secret(private_key => $private_key) or die "No secret.\n";
print $secret;
}
else {
print $file->secret;
}
lib/App/GroupSecret.pm view on Meta::CPAN
}
my $file = $self->file;
if ($keep_passphrase) {
my $private_key = $self->private_key;
$passphrase = $file->decrypt_secret_passphrase($private_key);
$file->encrypt_secret($secret, $passphrase);
}
else {
$passphrase = generate_secure_random_bytes(32);
$file->encrypt_secret($secret, $passphrase);
lib/App/GroupSecret.pm view on Meta::CPAN
print "SKIP\t$formatted_key\n";
next;
}
if ($file->secret && !$opts->{passphrase}) {
my $private_key = $self->private_key;
my $passphrase = $file->decrypt_secret_passphrase($private_key);
$opts->{passphrase} = $passphrase;
}
local $opts->{fingerprint_info} = $info;
my ($fingerprint, $key) = $file->add_key($public_key, $opts);
lib/App/GroupSecret.pm view on Meta::CPAN
$file = $script->file;
Get the L<App::GroupSecret::File> instance for the keyfile.
=head2 private_key
$filepath = $script->private_key;
Get the path to a private key used to decrypt the keyfile.
=head1 BUGS
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Ikaros.pm view on Meta::CPAN
=head3 [HOST CONFIGURATION] : config/hosts.yaml
# default status each hosts
default:
user: $USER_NAME # username for ssh connection
private_key: $HOME/.ssh/id_rsa # private_key for ssh connection
runner: forkprove # executor of main command ('prove' or 'forkprove')
coverage: true # enable testing coverage
perlbrew: true # find perl binary using perlbrew
workdir: $HOME/ikaros_workspace # working directory for testing
view all matches for this distribution
view release on metacpan or search on metacpan
public/javascripts/ace/mode-php.js view on Meta::CPAN
openssl_csr_new|openssl_csr_sign|openssl_decrypt|openssl_dh_compute_key|openssl_digest|openssl_encrypt|openssl_error_string|\
openssl_free_key|openssl_get_cipher_methods|openssl_get_md_methods|openssl_get_privatekey|openssl_get_publickey|openssl_open|\
openssl_pkcs12_export|openssl_pkcs12_export_to_file|openssl_pkcs12_read|openssl_pkcs7_decrypt|openssl_pkcs7_encrypt|openssl_pkcs7_sign|\
openssl_pkcs7_verify|openssl_pkey_export|openssl_pkey_export_to_file|openssl_pkey_free|openssl_pkey_get_details|openssl_pkey_get_private|\
openssl_pkey_get_public|openssl_pkey_new|openssl_private_decrypt|openssl_private_encrypt|openssl_public_decrypt|openssl_public_encrypt|\
openssl_random_pseudo_bytes|openssl_seal|openssl_sign|openssl_verify|openssl_x509_check_private_key|openssl_x509_checkpurpose|\
openssl_x509_export|openssl_x509_export_to_file|openssl_x509_free|openssl_x509_parse|openssl_x509_read|ord|outeriterator|\
outofboundsexception|outofrangeexception|output_add_rewrite_var|output_reset_rewrite_vars|overflowexception|overload|override_function|\
ovrimos_close|ovrimos_commit|ovrimos_connect|ovrimos_cursor|ovrimos_exec|ovrimos_execute|ovrimos_fetch_into|ovrimos_fetch_row|\
ovrimos_field_len|ovrimos_field_name|ovrimos_field_num|ovrimos_field_type|ovrimos_free_result|ovrimos_longreadlen|ovrimos_num_fields|\
ovrimos_num_rows|ovrimos_prepare|ovrimos_result|ovrimos_result_all|ovrimos_rollback|pack|parentiterator|parse_ini_file|parse_ini_string|\
public/javascripts/ace/mode-php.js view on Meta::CPAN
],
"openssl_verify": [
"int openssl_verify(string data, string signature, mixed key[, mixed method])",
"Verifys data"
],
"openssl_x509_check_private_key": [
"bool openssl_x509_check_private_key(mixed cert, mixed key)",
"Checks if a private key corresponds to a CERT"
],
"openssl_x509_checkpurpose": [
"int openssl_x509_checkpurpose(mixed x509cert, int purpose, array cainfo [, string untrustedfile])",
"Checks the CERT to see if it can be used for the purpose in purpose. cainfo holds information about trusted CAs"
view all matches for this distribution
view release on metacpan or search on metacpan
local/lib/perl5/x86_64-linux-gnu-thread-multi/Crypt/OpenSSL/RSA.pm view on Meta::CPAN
Crypt::OpenSSL::Random::random_seed($good_entropy);
Crypt::OpenSSL::RSA->import_random_seed();
$rsa_pub = Crypt::OpenSSL::RSA->new_public_key($key_string);
$ciphertext = $rsa->encrypt($plaintext);
$rsa_priv = Crypt::OpenSSL::RSA->new_private_key($key_string);
$plaintext = $rsa->encrypt($ciphertext);
$rsa = Crypt::OpenSSL::RSA->generate_key(1024); # or
$rsa = Crypt::OpenSSL::RSA->generate_key(1024, $prime);
print "private key is:\n", $rsa->get_private_key_string();
print "public key (in PKCS1 format) is:\n",
$rsa->get_public_key_string();
print "public key (in X509 format) is:\n",
$rsa->get_public_key_x509_string();
local/lib/perl5/x86_64-linux-gnu-thread-multi/Crypt/OpenSSL/RSA.pm view on Meta::CPAN
else {
croak "unrecognized key format";
}
}
=item new_private_key
Create a new C<Crypt::OpenSSL::RSA> object by loading a private key in
from an string containing the Base64/DER encoding of the PKCS1
representation of the key. The string should include the
C<-----BEGIN...-----> and C<-----END...-----> lines. The padding is set to
local/lib/perl5/x86_64-linux-gnu-thread-multi/Crypt/OpenSSL/RSA.pm view on Meta::CPAN
-----BEGIN PUBLIC KEY------
-----END PUBLIC KEY------
and is the format that is produced by running C<openssl rsa -pubout>.
=item get_private_key_string
Return the Base64/DER-encoded PKCS1 representation of the private
key. This string has
header and footer lines:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/sqitch-authentication.pod view on Meta::CPAN
=item Snowflake
Snowflake does not support password-less authentication, but does support
key-pair authentication. Follow
L<the instructions|https://docs.snowflake.com/en/user-guide/key-pair-auth>
to create a key pair, then set the C<private_key_path> in the F<~/.snowsql/config>
to point to the private key file:
private_key_path = "<path>/rsa_key.p8"
To connect, set the C<$SNOWSQL_PRIVATE_KEY_PASSPHRASE> environment variable to
the passphrase for the private key, and add these parameters under the
configuration for your DSN in F</etc/odbc.ini> or F<~/.odbc.ini>:
lib/sqitch-authentication.pod view on Meta::CPAN
=item * C<uid=$username>
=item * C<priv_key_file=path/to/privatekey.p8>
=item * C<priv_key_file_pwd=$private_key_password>
=back
For example:
view all matches for this distribution
view release on metacpan or search on metacpan
t/samples/percona-compiled.txt view on Meta::CPAN
session-track-schema TRUE
session-track-state-change FALSE
session-track-system-variables time_zone,autocommit,character_set_client,character_set_results,character_set_connection
session-track-transaction-info OFF
sha256-password-auto-generate-rsa-keys TRUE
sha256-password-private-key-path private_key.pem
sha256-password-proxy-users FALSE
sha256-password-public-key-path public_key.pem
show-compatibility-56 FALSE
show-old-temporals FALSE
show-slave-auth-info FALSE
view all matches for this distribution
view release on metacpan or search on metacpan
if ($h) {
print "$desc\n$usage";
exit;
}
my $private_key_path = $k || "";
# put built-in commands into a hash
my %Builtins;
while (<DATA>) {
my ($name, $cmd) = split ' ', $_, 2;
my %ssh;
for my $host (@hosts) {
$ssh{$host} = Net::OpenSSH->new(
$host,
user => $user,
key_path => $private_key_path,
async => 1,
timeout => 3,
master_stderr_discard => 1, # don't show the MOTD
);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/sslmaker.pm view on Meta::CPAN
new_certs_dir = $dir/newcerts
certificate = <%= $stash->{cert} || '$dir/certs/ca.cert.pem' %>
serial = $dir/serial
crlnumber = $dir/crlnumber
crl = <%= $stash->{crl} || '$dir/crl.pem' %>
private_key = <%= $stash->{key} || '$dir/private/ca.key.pem' %>
RANDFILE = $dir/private/.rand
crl_extensions = crl_ext
name_opt = ca_default
cert_opt = ca_default
default_days = <%= $stash->{days} || DEFAULT_DAYS %>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apple/AppStoreConnect.pm view on Meta::CPAN
use Apple::AppStoreConnect;
my $asc = Apple::AppStoreConnect->new(
issuer => $API_key_issuer, # API key issuer ID
key_id => $key_id, # App Store Connect API key ID
key => $private_key # Encrypted private key (PEM)
);
# Custom API request
my $res = $asc->get(url => $url);
lib/Apple/AppStoreConnect.pm view on Meta::CPAN
=head2 C<new>
my $asc = Apple::AppStoreConnect->new(
key_id => $key_id,
key => $private_key?,
key_file => $private_key_pem?,
issuer => "57246542-96fe-1a63-e053-0824d011072a",
scope => \@scope?,
timeout => $timeout_sec?,
expiration => $expire_secs?,
ua => $lwp_ua?,
lib/Apple/AppStoreConnect.pm view on Meta::CPAN
by passing your app's bundle ID to the JWT payload. So there is just one addition to the constructor call:
my $assa = Apple::AppStoreConnect->new(
issuer => $API_key_issuer,
key_id => $key_id,
key => $private_key,
jwt_payload => {bid => $bundle_id}
);
You can then pass custon Store Server API requests:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Artifactory/Client.pm view on Meta::CPAN
sub get_gpg_public_key {
my $self = shift;
return $self->_handle_gpg_key( 'public', 'get' );
}
=head2 set_gpg_private_key( key => $string )
Sets the private key that Artifactory will use to sign Debian packages
=cut
sub set_gpg_private_key {
my ( $self, %args ) = @_;
my $key = $args{key};
return $self->_handle_gpg_key( 'private', 'put', content => $key );
}
view all matches for this distribution
view release on metacpan or search on metacpan
Password => "",
Verbosity => 0
) or die $rsa->errstr();
my $private_str=private_key_to_string($private);
$private_str="private,".$private_str;
my $cipher=new Aut::Crypt($pass);
$private_str=$cipher->encrypt($private_str);
my @pub;
push @pub,$string;
return $key->deserialize(String => \@pub);
}
sub private_key_to_string {
my $key=shift;
return $key->serialize();
}
sub string_to_private_key {
my $string=shift;
my $key=new Crypt::RSA::Key::Private;
my @pub;
push @pub,$string;
return $key->deserialize(String => \@pub);
return undef;
}
else {
$private_str=substr($private_str,8,length($private_str));
my $private=string_to_private_key($private_str);
$text=$self->{"base64"}->decode($text);
$text=$rsa->decrypt(
Cyphertext => $text,
Key => $private,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Authen/HTTP/Signature/Method/RSA.pm view on Meta::CPAN
=cut
sub sign {
my $self = shift;
my $key = Crypt::OpenSSL::RSA->new_private_key($self->key);
confess "I don't have a key!" unless $key;
$self->_set_digest($key);
my $s = $key->sign($self->data);
view all matches for this distribution
view release on metacpan or search on metacpan
eg/mod_auth_pubtkt.pl view on Meta::CPAN
sub parse_command_line;
sub show_help;
sub show_version;
my $private_key_file;
my $public_key_file;
my $key_type;
my $ticket;
my $username = $ENV{USER};
my $ip = "127.0.0.1";
eg/mod_auth_pubtkt.pl view on Meta::CPAN
##
parse_command_line();
if ( $operation eq "generate" ) {
my $ticket = pubtkt_generate(
privatekey => $private_key_file,
keytype => $key_type,
clientip => $ip,
userid => $username,
validuntil => $valid_until,
graceperiod=> $grace_period,
eg/mod_auth_pubtkt.pl view on Meta::CPAN
sub parse_command_line
{
my $rc = GetOptions(
"help" => \&show_help,
"private-key=s" => \$private_key_file,
"public-key=s" => \$public_key_file,
"rsa" => sub { $key_type = "rsa" ; },
"dsa" => sub { $key_type = "dsa" ; },
"ticket=s" => \$ticket,
"ip=s" => \$ip,
eg/mod_auth_pubtkt.pl view on Meta::CPAN
die "Error: No operation specified. Use --generate or --verify. See --help for details.\n" unless $operation;
if ( $operation eq "generate" ) {
die "Error: missing private key file. Use --private-key=FILE. See --help for details.\n" unless $private_key_file;
}
elsif ( $operation eq "verify" ) {
die "Error: missing ticket. Use --ticket TICKET. See --help for details.\n" unless $ticket;
}
die "Error: missing key type. Use --rsa or --dsa. See --help for details." unless $key_type;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Authen/NZRealMe/ServiceProvider/CertFactory.pm view on Meta::CPAN
die "'$conf_dir' is not a directory\n" unless -d "$conf_dir/.";
$args{domain} =~ s/^(www|secure)[.]//;
my $key_file = "$conf_dir/sp-sign-key.pem";
_generate_private_key($key_file);
_generate_certificate('sig', $key_file, \%args);
$key_file = "$conf_dir/sp-ssl-key.pem";
_generate_private_key($key_file);
_generate_certificate('ssl', $key_file, \%args);
if(not $args{self_signed}) {
print "\nSuccessfully generated two certificate signing requests.\n"
. "You can dump the CSR contents to confirm with:\n\n"
lib/Authen/NZRealMe/ServiceProvider/CertFactory.pm view on Meta::CPAN
return 0 if $resp =~ /^(n|no)$/i;
}
}
sub _generate_private_key {
my($key_path) = @_;
system('openssl', 'genrsa', '-out', $key_path, '2048') == 0
or exit 1;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Authen/Ticket/Signature.pm view on Meta::CPAN
return '';
}
# called to either retrieve stored private key or generate public/private
# pair
sub get_private_key {
my $self = shift;
# tie_keys;
my $id = $self->{TicketSignatureId} || '<none>';
lib/Authen/Ticket/Signature.pm view on Meta::CPAN
}
sub sign_ticket {
my($self, $ticket) = @_;
my $private_key = $self->get_private_key;
return '' unless $private_key;
my($p, $g, $x) = map $private_key->{$_}, (qw/p g x/);
my $msg = OpenSSL::BN::hex2bn(MD5->hexhash($ticket));
my $k;
do { $k = OpenSSL::BN::rand( $p->num_bits - 1);
} until $k->gcd( $p - 1 ) == 1;
lib/Authen/Ticket/Signature.pm view on Meta::CPAN
{ 'y' => $y, 'p' => $p, 'g' => $g }
This is returned by the key server as the string "y:$y;p:$p;g:$g" with
the values in hexadecimal.
=item $self->get_private_key
This routine will return the private key as appropriate according to the
server configuration. If the required key is not available in cache, it
will be generated. Since the private key is only to be used on the machine
it is generated on, it does not make sense to fetch the private key from
lib/Authen/Ticket/Signature.pm view on Meta::CPAN
This routine must return the private and public key parts with a nominal
key length of $key_length. See the get_{private,public}_key routines
for the format of the key parts. The actual value returned is an array
of the format:
( { private_key }, { public_key } )
=item $self->sign_ticket( $ticket )
This routine should attach a signature to $ticket and return the resulting
value. The format used must be understood by $self->verify_ticket. The
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Authen/U2F/Tester.pm view on Meta::CPAN
}
}
# generate a new keypair for this application
my $keypair = Authen::U2F::Tester::Keypair->new;
my $handle = $self->keystore->put($keypair->private_key);
my $cert = $self->certificate->as_string(Crypt::OpenSSL::X509::FORMAT_ASN1);
my %client_data = (
typ => 'navigator.id.finishEnrollment',
challenge => $challenge,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bitcoin/Crypto/BIP44.pm view on Meta::CPAN
# stringifies automatically
say "$path";
# can be used in key derivation
$ext_private_key->derive_key($path);
=head1 DESCRIPTION
This class is a helper for constructing BIP44-compilant key derivation paths.
BIP44 describes the mechanism the HD (Hierarchical Deterministic) wallets use
view all matches for this distribution