view release on metacpan or search on metacpan
key_utils.c view on Meta::CPAN
const char *cPem = pemstring;
in = BIO_new(BIO_s_mem());
BIO_puts(in, cPem);
key = PEM_read_bio_ECPrivateKey(in, NULL, NULL, NULL);
res = EC_KEY_get0_private_key(key);
eckey = EC_KEY_new_by_curve_name(NID_secp256k1);
group = EC_KEY_get0_group(eckey);
pub_key = EC_POINT_new(group);
EC_KEY_set_private_key(eckey, res);
if (!EC_POINT_mul(group, pub_key, res, NULL, NULL, ctx)) {
return ERROR;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Business/OnlinePayment/Braintree.pm view on Meta::CPAN
use Business::OnlinePayment;
$tx = new Business::OnlinePayment('Braintree',
merchant_id => 'your merchant id',
public_key => 'your public key',
private_key => 'your private key',
);
$tx->test_transaction(1); # sandbox transaction for development and tests
$tx->content(amount => 100,
view all matches for this distribution
view release on metacpan or search on metacpan
share/examples/compare/Nes/.nes.cfg view on Meta::CPAN
# Nes config file
# private key
private_key = ChangeThisPassword
view all matches for this distribution
view release on metacpan or search on metacpan
#######################################################################
# Settings
user 'cpantesters';
private_key '~/.ssh/cpantesters-rex';
# Used to find local, dev copies of the dist
set 'dist_name' => 'CPAN-Testers-API';
#######################################################################
view all matches for this distribution
view release on metacpan or search on metacpan
#######################################################################
# Settings
user 'cpantesters';
private_key '~/.ssh/cpantesters-rex';
# Used to find local, dev copies of the dist
set 'dist_name' => 'CPAN-Testers-Backend';
#######################################################################
view all matches for this distribution
view release on metacpan or search on metacpan
t/config/profiles.conf view on Meta::CPAN
default = cpantesters
[cpantesters]
access_key_id = XXXXXXXXXXXXXXXXXXXX
secret_access_key = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
certificate_file = my-cert.pem
private_key_file = my-key.pem
ec2_keypair_name = my-ec2-keypair
ec2_keypair_file = ec2-private-key.pem
aws_account_id = 0123-4567-8901
canonical_user_id = 64-character-string
view all matches for this distribution
view release on metacpan or search on metacpan
#######################################################################
# Settings
user 'cpantesters';
private_key '~/.ssh/cpantesters-rex';
# Used to find local, dev copies of the dist
set 'dist_name' => 'CPAN-Testers-Schema';
#######################################################################
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Captcha/NocaptchaMailru.pm view on Meta::CPAN
return join('&', @pairs);
}
sub _generate_check_url {
my ($key, $id, $val) = @_;
return API_SERVER . '/check?' . _pack_params({'private_key' => $key,
'captcha_id' => $id,
'captcha_value' => $val});
}
sub check_detailed {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Captcha/reCAPTCHA.pm view on Meta::CPAN
# Version 1 (not recommended)
print $c->get_html( 'your public key here' );
# Verify submission
my $result $c->check_answer_v2($private_key, $response, $ENV{REMOTE_ADDR});
# Verify submission (Old Version)
my $result = $c->check_answer(
'your private key here', $ENV{'REMOTE_ADDR'},
$challenge, $response
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catalyst/Model/WebService/MyGengo.pm view on Meta::CPAN
use parent qw( Catalyst::Model::WebService::MyGengo );
__PACKAGE__->config({
class => 'WebService::MyGengo::Client'
, public_key => 'your API public key'
, private_key => 'your API private key'
, use_sandbox => 0 # Whether to use the production site or the sandbox
# See WebService::MyGengo::Client for other options
});
1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Chef.pm view on Meta::CPAN
my ($self,$hosted_chef) = (@_);
$self->{ 'HOSTED_CHEF_' } = $hosted_chef if defined $server;;
return $self->{ 'HOSTED_CHEF' };
}
sub private_key {
my ($self,$private_key) = (@_);
$self->{ 'CHEF_CLIENT_PRIVATE_KEY' } = $private_key if defined $private_key;
return $self->{ 'CHEF_CLIENT_PRIVATE_KEY' };
}
}#nwe
__DATA__
view all matches for this distribution
view release on metacpan or search on metacpan
Fields starting with a leading underscore, C<_>, are private: they are
still valid fields, but C<Class::Struct::FIELDS> does not create
subroutines to access them. Instead, you should access them the usual
way for hash members:
$self->{_private_key}; # ok
$self->_private_key; # Compilation error
See L<fields> for more details.
=head2 Extra magic: auto-stringify
view all matches for this distribution
view release on metacpan or search on metacpan
#
# Tplanas daily provision workfacts report
45 23 * * 1-5 bash -c /opt/deploy/code/portal/script/report_daily_provision_workfacts.pl
## Import CAPSiDE aliases to show in portal.capside.com
#3-59/10 * * * * /usr/bin/scp -i /home/portal/ialonso/private_key/portal.key portal@n020125.sys.capside.net:/home/portal/output.file /home/portal/ialonso/output.file
#
# CAPSiDE Ops Team Almighty Ticket Dispatching Tool (tm)
0,15,30,45 * * * 1-5 bash -c /opt/deploy/code/portal/script/dispatcher_unclassified_tickets
5 14 * * 1-5 bash -c /opt/deploy/code/portal/script/dispatcher_backup_patching_tickets
view all matches for this distribution
view release on metacpan or search on metacpan
examples/tsa3161 view on Meta::CPAN
open TSAKEY, "<$filename" or &dieif(1,"cannot open TSAKeyFile '$filename'");
binmode TSAKEY;
my $tsa_key_pem;
read TSAKEY, $tsa_key_pem, $size;
close TSAKEY;
$tsa_key = Crypt::OpenSSL::RSA->new_private_key($tsa_key_pem) or &dieif(1,"TSAKeyFile '$filename' cannot be decoded");
}
# some magic
my $time = Time::HiRes::gettimeofday() ;
my $now = int($time);
view all matches for this distribution
view release on metacpan or search on metacpan
t/cryptoki.t view on Meta::CPAN
unwrap => 1,
label => 'test',
id => pack('C*', 0x01, 0x02, 0x03)
);
my ( $public_key, $private_key ) = $session->generate_key_pair($t_public,$t_private);
try {
my $plain_text = 'plain text';
my ( $encrypted_text_ref, $len ) = $public_key->encrypt(\$plain_text, length($plain_text));
( $encrypted_text_ref ) = $private_key->decrypt($encrypted_text_ref, $len);
diag $$encrypted_text_ref;
diag explain $public_key->get_attributes(1);
diag $public_key->export_as_string;
diag explain $private_key->get_attributes(1);
} catch { diag $_; 0 };
ok $public_key->destroy;
ok $private_key->destroy;
done_testing();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypt/ECDH_ES.pm view on Meta::CPAN
my $mac = hmac_sha256($iv . $ciphertext, $sign_key);
return pack $format_unauthenticated, '', $public, $mac, $ciphertext;
}
sub ecdhes_decrypt {
my ($private_key, $packed_data) = @_;
my ($options, $public, $mac, $ciphertext) = unpack $format_unauthenticated, $packed_data;
croak 'Unknown options' if $options ne '';
my $shared = curve25519_shared_secret($private_key, $public);
my ($encrypt_key, $sign_key) = unpack 'a16 a16', sha256($shared);
my $iv = substr sha256($public), 0, 16;
croak 'MAC is incorrect' if hmac_sha256($iv . $ciphertext, $sign_key) ne $mac;
my $cipher = Crypt::Rijndael->new($encrypt_key, Crypt::Rijndael::MODE_CBC);
view all matches for this distribution
view release on metacpan or search on metacpan
t/softhsm.t view on Meta::CPAN
'public-exponent' => [ 1, 0, 1 ],
label => 'test_pub',
id => [ 1, 2, 3 ],
);
my %private_key_template = (
class => 'private-key',
'key-type' => 'rsa',
token => 0,
private => 1,
sensitive => 1,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypt/JWT.pm view on Meta::CPAN
return Crypt::PK::RSA->new(@$key) if ref($key) eq 'ARRAY';
# handle also: Crypt::OpenSSL::RSA, Crypt::X509, Crypt::OpenSSL::X509
my $str;
if (ref($key) eq 'Crypt::OpenSSL::RSA') {
# https://metacpan.org/pod/Crypt::OpenSSL::RSA
$str = $key->is_private ? $key->get_private_key_string : $key->get_public_key_string;
}
elsif (ref($key) =~ /^Crypt::(X509|OpenSSL::X509)$/) {
# https://metacpan.org/pod/Crypt::X509
# https://metacpan.org/pod/Crypt::OpenSSL::X509
$str = $key->pubkey;
view all matches for this distribution
view release on metacpan or search on metacpan
}
BIO_free(b);
}
else {
//we got an engine
if(!(key = ENGINE_load_private_key(config->handle->configuration->engine, key_str, NULL, NULL))) {
scep_log(config->handle, ERROR, "Loading private key from engine failed");
create_err_msg(config, NULL);
}
}
return key;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypt/MatrixSSL3.pm view on Meta::CPAN
# based on the requested hostname
# virtual host 0 (also referred in the code as SNI entry 0)
{
'hostname' => 'hostname', # regular expression for matching the hostname
'cert' => '/path/to/certificate;/path/to/CA-chain', # KEY - certificate (the CA-chain is optional)
'key' => '/path/to/private_key', # KEY - private key
'DH_param' => /path/to/DH_params', # KEY - file containing the DH parameter used with DH ciphers
'session_ticket_keys' => { # session tickets setup
'id' => '1234567890123456', # KEY - TLS session tickets - 16 bytes unique identifier
'encrypt_key' => '12345678901234567890123456789012', # KEY - TLS session tickets - 128/256 bit encryption key
'hash_key' => '12345678901234567890123456789012', # KEY - TLS session tickets - 256 bit hash key
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/NSS/SSL.pm view on Meta::CPAN
=item listen ( $queue_length : integer )
Listens for connections on the socket. The optional argument I<$queue_length> is the maximum length of the queue of
pending connections. Defaults to 10.
=item configure_as_server ( $certificate : Crypt::NSS::Certificate, $private_key : Crypt::NSS::PrivateKey )
Configures a listening socket with the information needed to handshake as a SSL server.
=item accept ( ) : Net::NSS::SSL
=item accept ( $timeout : integer ) : Net::NSS::SSL
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypt/Nettle/RSA.pm view on Meta::CPAN
Create a new public key from the modulus and the exponent of the
public key. (see DATA REPRESENTATIONS below for how to format $n and
$e)
=head2 new_private_key($d, $p, $q)
Create a new private key from the private exponent and the two prime
factors. (see DATA REPRESENTATIONS below for how to format $d, $p and
$q)
view all matches for this distribution
view release on metacpan or search on metacpan
t/02.derive_key_pair.t view on Meta::CPAN
my $hash_name = 'SHA256';
my $expand_message_func = \&expand_message_xmd;
my $ec_key_r = derive_key_pair($group_name, $seed, $info, "DeriveKeyPair".$context_string, $hash_name, $expand_message_func);
#my $skS_bn = $skS->get0_private_key();
is($ec_key_r->{priv_bn}->to_hex(), 'E7DB44B7F7495298770AF98417FDEEC6C8299562325E9330A79EEBF3D2A1A765', 'derive_key_pair');
done_testing;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypt/OPRF.pm view on Meta::CPAN
#my $pkS_point = $ec_key_r->{pub_point};
#my $skS_key = Crypt::OpenSSL::EC::EC_KEY::new();
#$skS_key->set_group($group);
#$skS_key->set_private_key($skS);
#my $pkS_point = Crypt::OpenSSL::EC::EC_KEY::get0_public_key($skS_key);
#my $pkS_key = Crypt::OpenSSL::EC::EC_KEY::new();
#Crypt::OpenSSL::EC::EC_KEY::set_group($pkS_key, $group);
#Crypt::OpenSSL::EC::EC_KEY::set_public_key($pkS_key, $pkS_point);
view all matches for this distribution