view release on metacpan or search on metacpan
lib/CryptoTron/CreateAccount.pm view on Meta::CPAN
# Generate seed with automatic language detection and empty passphrase.
seed_bytes = Bip39SeedGenerator(mnemonic).Generate()
# Create Bip44 Tron object.
bip44_tron = Bip44.FromSeed(seed_bytes, Bip44Coins.TRON)
# Create a private key in hex and upper case.
private_key = bip44_tron.PrivateKey().Raw().ToHex().upper()
# Create a public key in upper case.
public_key = str(bip44_tron.PublicKey().RawUncompressed()).upper()
# Create Base58 address.
base58_addr = bip44_tron.PublicKey().ToAddress()
# Create a Hex address in hex and upper case.
hex_addr = base58.b58decode_check(base58_addr).hex().upper()
# Print result to screen.
print(fmt_str.format("Private Key:", private_key))
print(fmt_str.format("Address (Base58):", base58_addr))
print(fmt_str.format("Address (Hex): ", hex_addr))
print(fmt_str.format("Public Key: ", public_key))
def mnemonic():
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DJabberd.pm view on Meta::CPAN
}
# mimicing Apache's SSLCertificateKeyFile config
sub set_config_sslcertificatekeyfile {
my ($self, $val) = @_;
$self->{ssl_private_key_file} = as_abs_path($val);
}
# mimicing Apache's SSLCertificateFile
sub set_config_sslcertificatefile {
my ($self, $val) = @_;
lib/DJabberd.pm view on Meta::CPAN
sub set_config_sslcertificatechainfile {
my ($self, $val) = @_;
$self->{ssl_cert_chain_file} = as_abs_path($val);
}
sub ssl_private_key_file { return $_[0]{ssl_private_key_file} }
sub ssl_cert_file { return $_[0]{ssl_cert_file} }
sub ssl_cert_chain_file { return $_[0]{ssl_cert_chain_file} }
sub set_config_oldssl {
my ($self, $val) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
_Deparsed_XSubs.pm view on Meta::CPAN
sub check_key;
sub decrypt;
sub encrypt;
sub generate_key;
sub get_key_parameters;
sub get_private_key_string;
sub get_public_key_string;
sub get_public_key_x509_string;
sub import_random_seed;
sub is_private;
sub new_key_from_parameters;
sub new_private_key;
sub new_public_key;
sub private_encrypt;
sub public_decrypt;
sub sign;
sub size;
_Deparsed_XSubs.pm view on Meta::CPAN
sub COMP_add_compression_method($$) ;
sub CTX_add_client_CA($$) ;
sub CTX_add_extra_chain_cert($$) ;
sub CTX_add_session($$) ;
sub CTX_callback_ctrl($$$) ;
sub CTX_check_private_key($) ;
sub CTX_ctrl($$$$) ;
sub CTX_flush_sessions($$) ;
sub CTX_free($) ;
sub CTX_get0_param($) ;
sub CTX_get_app_data($) ;
_Deparsed_XSubs.pm view on Meta::CPAN
sub alert_desc_string($) ;
sub alert_desc_string_long($) ;
sub alert_type_string($) ;
sub alert_type_string_long($) ;
sub callback_ctrl($$$) ;
sub check_private_key($) ;
sub clear($) ;
sub clear_num_renegotiations($) ;
sub client_hello_get0_ciphers($) ;
sub client_hello_get0_compression_methods($) ;
sub client_hello_get0_ext($$) ;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer/Plugin/reCAPTCHA.pm view on Meta::CPAN
register recaptcha_check => sub {
my ( $response ) = @_;
my $conf = plugin_setting();
return $rc->verify(
$conf->{ private_key },
$response,
request->remote_address,
);
};
lib/Dancer/Plugin/reCAPTCHA.pm view on Meta::CPAN
# In your config.yml
plugins:
reCAPTCHA:
public_key: "public key goes here"
private_key: "private key goes here"
theme: "dark"
type: "image"
size: "normal"
# In your Dancer app...
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer/Error.pm view on Meta::CPAN
my $censored = 0;
for my $key (keys %$hash) {
if (ref $hash->{$key} eq 'HASH') {
$censored += _censor( $hash->{$key}, $recursecount );
}
elsif ($key =~ /(pass|card?num|pan|cvv2?|ccv|secret|private_key|cookie_key)/i) {
$hash->{$key} = "Hidden (looks potentially sensitive)";
$censored++;
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Censor.pm view on Meta::CPAN
};
} else {
$self->{is_sensitive_field} = {
map { $_ => 1 } qw(
pass password old_password secret
private_key cardnum card_number pan
cvv cvv2 ccv
)
};
}
view all matches for this distribution
view release on metacpan or search on metacpan
Set client-side certificate chain. This is used to authenticate the client on the server-side. This should contain the entire Certificate chain starting with the certificate itself.
Return: CASS_OK if successful, otherwise an error occurred
=head3 ssl_set_private_key
my $int_CassError = $cass->ssl_set_private_key($ssl, $key, $password);
Set client-side private key. This is used to authenticate the client on the server-side.
Return: CASS_OK if successful, otherwise an error occurred
view all matches for this distribution
view release on metacpan or search on metacpan
# Use the PK- of this Mobile::Executive invocation to
# sign the encrypted mobile agent.
my $cypher_signature = $rsa->sign(
Message => $cyphertext,
Key => $Mobile::Executive::private_key,
Armour => $TRUE
) or die $rsa->errstr, "\n";
# Networking code to send agent to the server starts here.
view all matches for this distribution
view release on metacpan or search on metacpan
examples/gce_sa_explicit.pl view on Meta::CPAN
#the repositories, but you can see the tags of a repo if you know its name
my $repo = $ARGV[0];
my $sa = Docker::Registry::Auth::GCEServiceAccount->new(
client_email => $ce,
private_key => $pk,
);
my $r = Docker::Registry::GCE->new(
auth => $sa,
);
view all matches for this distribution
view release on metacpan or search on metacpan
_Deparsed_XSubs.pm view on Meta::CPAN
sub COMP_add_compression_method($$) ;
sub CTX_add_client_CA($$) ;
sub CTX_add_extra_chain_cert($$) ;
sub CTX_add_session($$) ;
sub CTX_callback_ctrl($$$) ;
sub CTX_check_private_key($) ;
sub CTX_ctrl($$$$) ;
sub CTX_flush_sessions($$) ;
sub CTX_free($) ;
sub CTX_get0_param($) ;
sub CTX_get_app_data($) ;
_Deparsed_XSubs.pm view on Meta::CPAN
sub alert_desc_string($) ;
sub alert_desc_string_long($) ;
sub alert_type_string($) ;
sub alert_type_string_long($) ;
sub callback_ctrl($$$) ;
sub check_private_key($) ;
sub clear($) ;
sub clear_num_renegotiations($) ;
sub client_version($) ;
sub connect($) ;
sub constant($) ;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/EAI/Wrap.pm view on Meta::CPAN
# site.config
%config = (
sensitive => {
dbSys => {user => "DBuser", pwd => "DBPwd"},
ftpSystem1 => {user => "FTPuser", pwd => "FTPPwd", privKey => 'path_to_private_key', hostkey =>'hostkey'},
},
checkLookup => {"task_script.pl" => {errmailaddress => "test\@test.com", errmailsubject => "testjob failed", timeToCheck => "0800", freqToCheck => "B", logFileToCheck => "test.log", logcheck => "started.*"}},
executeOnInit => sub {$execute{addToScriptName} = "doWhateverHereToModifySettings";},
folderEnvironmentMapping => {Test => "Test", Dev => "Dev", "" => "Prod"},
errmailaddress => 'your@mail.address',
lib/EAI/Wrap.pm view on Meta::CPAN
FTP => {
remoteHost => {"Prod" => "ftp.com", "Test" => "ftp-test.com"},
remoteDir => "/reports",
port => 22,
user => "myuser",
privKey => 'C:/keystore/my_private_key.ppk',
FTPdebugLevel => 0, # ~(1|2|4|8|16|1024|2048)
},
DB => {
tablename => "ValueTable",
deleteBeforeInsertSelector => "rptDate = ?",
view all matches for this distribution
view release on metacpan or search on metacpan
fail_connection(self, "SSL_CTX_load_verify_locations failed");
return;
}
}
/* Mutual TLS: load client certificate + private key when both
* are configured. SSL_CTX_check_private_key verifies that the
* private key matches the loaded certificate's public half. */
if (self->tls_cert_file && self->tls_key_file) {
if (SSL_CTX_use_certificate_chain_file(self->ssl_ctx, self->tls_cert_file) != 1) {
capture_tls_error(self);
fail_connection(self, "SSL_CTX_use_certificate_chain_file failed");
if (SSL_CTX_use_PrivateKey_file(self->ssl_ctx, self->tls_key_file, SSL_FILETYPE_PEM) != 1) {
capture_tls_error(self);
fail_connection(self, "SSL_CTX_use_PrivateKey_file failed");
return;
}
if (SSL_CTX_check_private_key(self->ssl_ctx) != 1) {
capture_tls_error(self);
fail_connection(self, "TLS client cert / private key mismatch");
return;
}
} else if (self->tls_cert_file || self->tls_key_file) {
view all matches for this distribution
view release on metacpan or search on metacpan
deps/hiredis/hiredis_ssl.h view on Meta::CPAN
/* Options to create an OpenSSL context. */
typedef struct {
const char *cacert_filename;
const char *capath;
const char *cert_filename;
const char *private_key_filename;
const char *server_name;
int verify_mode;
} redisSSLOptions;
/**
deps/hiredis/hiredis_ssl.h view on Meta::CPAN
* and use for validation.
*
* capath is an optional directory path where trusted CA certificate files are
* stored in an OpenSSL-compatible structure.
*
* cert_filename and private_key_filename are optional names of a client side
* certificate and private key files to use for authentication. They need to
* be both specified or omitted.
*
* server_name is an optional and will be used as a server name indication
* (SNI) TLS extension.
deps/hiredis/hiredis_ssl.h view on Meta::CPAN
* If error is non-null, it will be populated in case the context creation fails
* (returning a NULL).
*/
redisSSLContext *redisCreateSSLContext(const char *cacert_filename, const char *capath,
const char *cert_filename, const char *private_key_filename,
const char *server_name, redisSSLContextError *error);
/**
* Helper function to initialize an OpenSSL context that can be used
* to initiate SSL connections. This is a more extensible version of redisCreateSSLContext().
view all matches for this distribution
view release on metacpan or search on metacpan
src/EV__Nats.xs view on Meta::CPAN
uint16_t actual_crc = nats_crc16(raw, raw_len - 2);
if (expected_crc != actual_crc) return -1;
unsigned char *seed = raw + 2;
EVP_PKEY *pkey = EVP_PKEY_new_raw_private_key(EVP_PKEY_ED25519, NULL, seed, 32);
if (!pkey) return -1;
EVP_MD_CTX *ctx = EVP_MD_CTX_new();
if (!ctx) { EVP_PKEY_free(pkey); return -1; }
src/EV__Nats.xs view on Meta::CPAN
uint16_t expected_crc = (uint16_t)raw[raw_len - 2] | ((uint16_t)raw[raw_len - 1] << 8);
if (nats_crc16(raw, raw_len - 2) != expected_crc) return -1;
unsigned char *seed = raw + 2;
EVP_PKEY *pkey = EVP_PKEY_new_raw_private_key(EVP_PKEY_ED25519, NULL, seed, 32);
if (!pkey) return -1;
unsigned char pub[32];
size_t pub_len = 32;
int ok = EVP_PKEY_get_raw_public_key(pkey, pub, &pub_len) == 1;
view all matches for this distribution
view release on metacpan or search on metacpan
deps/hiredis/hiredis_ssl.h view on Meta::CPAN
/* Options to create an OpenSSL context. */
typedef struct {
const char *cacert_filename;
const char *capath;
const char *cert_filename;
const char *private_key_filename;
const char *server_name;
int verify_mode;
} redisSSLOptions;
/**
deps/hiredis/hiredis_ssl.h view on Meta::CPAN
* and use for validation.
*
* capath is an optional directory path where trusted CA certificate files are
* stored in an OpenSSL-compatible structure.
*
* cert_filename and private_key_filename are optional names of a client side
* certificate and private key files to use for authentication. They need to
* be both specified or omitted.
*
* server_name is an optional and will be used as a server name indication
* (SNI) TLS extension.
deps/hiredis/hiredis_ssl.h view on Meta::CPAN
* If error is non-null, it will be populated in case the context creation fails
* (returning a NULL).
*/
redisSSLContext *redisCreateSSLContext(const char *cacert_filename, const char *capath,
const char *cert_filename, const char *private_key_filename,
const char *server_name, redisSSLContextError *error);
/**
* Helper function to initialize an OpenSSL context that can be used
* to initiate SSL connections. This is a more extensible version of redisCreateSSLContext().
view all matches for this distribution
view release on metacpan or search on metacpan
Websockets.xs view on Meta::CPAN
info.http_proxy_port = proxy_port;
}
if (ssl_cert && strlen(ssl_cert) > 0) {
info.ssl_cert_filepath = ssl_cert;
info.ssl_private_key_filepath = ssl_key;
if (ssl_ca && strlen(ssl_ca) > 0)
info.ssl_ca_filepath = ssl_ca;
}
DEBUG_LOG("Creating context (manual integration)");
Websockets.xs view on Meta::CPAN
info.user = srv;
info.options = 0;
if (ssl_cert && ssl_key) {
info.ssl_cert_filepath = ssl_cert;
info.ssl_private_key_filepath = ssl_key;
if (ssl_ca)
info.ssl_ca_filepath = ssl_ca;
info.options |= LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT;
ensure_ssl_keepalive(); /* pin global init so vhost/context teardown won't OPENSSL_cleanup */
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Experian/IDAuth.pm view on Meta::CPAN
sub defaults {
my $self = shift;
return (
username => 'experian_user',
password => '?',
private_key => 'private_key',
public_key => 'public_key',
members_url => 'https://proveid.experian.com',
api_uri => 'http://corpwsdl.oneninetwo',
api_proxy => 'https://xml.proveid.experian.com/IDSearch.cfc',
header_ns_url => 'http://xml.proveid.experian.com/xsd/Headers',
lib/Experian/IDAuth.pm view on Meta::CPAN
sub _2fa_header {
my $self = shift;
my $loginid = $self->{username};
my $password = $self->{password};
my $private_key = $self->{private_key};
my $public_key = $self->{public_key};
my $timestamp = time();
my $hash = hmac_sha256_base64($loginid, $password, $timestamp, $private_key);
# Digest::SHA doesn't pad it's outputs so we have to do it manually.
while (length($hash) % 4) {
$hash .= '=';
}
view all matches for this distribution
view release on metacpan or search on metacpan
Ezmlm/GpgKeyRing.pm view on Meta::CPAN
Refer to the documentation of gnupg for the format of the arguments.
=cut
sub generate_private_key {
my ($self, $name, $comment, $email, $keysize, $expire) = @_;
my $gpg = $self->_get_gpg_object();
my $gpgoption = "--gen-key";
my $gpgcommand = $gpg->gpgbin() . " " . $gpg->gpgopts() . " $gpgoption";
my $pid = open(INPUT, "| $gpgcommand");
Ezmlm/GpgKeyRing.pm view on Meta::CPAN
my @keys = $self->_get_keys("pub");
return @keys;
}
# == get_private_keys ==
# see above for POD (get_public_keys)
sub get_secret_keys {
my ($self) = @_;
my @keys = $self->_get_keys("sec");
return @keys;
view all matches for this distribution
view release on metacpan or search on metacpan
deps/libfido2/src/es256.c view on Meta::CPAN
fido_log_debug("%s: EVP_PKEY_keygen", __func__);
goto fail;
}
if ((ec = EVP_PKEY_get0_EC_KEY(k)) == NULL ||
(d = EC_KEY_get0_private_key(ec)) == NULL ||
(n = BN_num_bytes(d)) < 0 || (size_t)n > sizeof(key->d) ||
(n = BN_bn2bin(d, key->d)) < 0 || (size_t)n > sizeof(key->d)) {
fido_log_debug("%s: EC_KEY_get0_private_key", __func__);
goto fail;
}
ok = 0;
fail:
deps/libfido2/src/es256.c view on Meta::CPAN
fido_log_debug("%s: BN_bin2bn", __func__);
goto fail;
}
if ((ec = EC_KEY_new_by_curve_name(nid)) == NULL ||
EC_KEY_set_private_key(ec, d) == 0) {
fido_log_debug("%s: EC_KEY_set_private_key", __func__);
goto fail;
}
if ((pkey = EVP_PKEY_new()) == NULL ||
EVP_PKEY_assign_EC_KEY(pkey, ec) == 0) {
view all matches for this distribution
view release on metacpan or search on metacpan
libtomcrypt/src/headers/tomcrypt_pk.h view on Meta::CPAN
int dh_set_pg_groupsize(int groupsize, dh_key *key);
int dh_set_key(const unsigned char *in, unsigned long inlen, int type, dh_key *key);
int dh_generate_key(prng_state *prng, int wprng, dh_key *key);
int dh_shared_secret(const dh_key *private_key, const dh_key *public_key,
unsigned char *out, unsigned long *outlen);
void dh_free(dh_key *key);
int dh_export_key(void *out, unsigned long *outlen, int type, const dh_key *key);
libtomcrypt/src/headers/tomcrypt_pk.h view on Meta::CPAN
int ecc_export_openssl(unsigned char *out, unsigned long *outlen, int type, const ecc_key *key);
int ecc_import_openssl(const unsigned char *in, unsigned long inlen, ecc_key *key);
int ecc_import_pkcs8(const unsigned char *in, unsigned long inlen, const void *pwd, unsigned long pwdlen, ecc_key *key);
int ecc_import_x509(const unsigned char *in, unsigned long inlen, ecc_key *key);
int ecc_shared_secret(const ecc_key *private_key, const ecc_key *public_key,
unsigned char *out, unsigned long *outlen);
int ecc_encrypt_key(const unsigned char *in, unsigned long inlen,
unsigned char *out, unsigned long *outlen,
prng_state *prng, int wprng, int hash,
libtomcrypt/src/headers/tomcrypt_pk.h view on Meta::CPAN
const void *pwd, unsigned long pwdlen,
curve25519_key *key);
int ed25519_sign(const unsigned char *msg, unsigned long msglen,
unsigned char *sig, unsigned long *siglen,
const curve25519_key *private_key);
int ed25519_verify(const unsigned char *msg, unsigned long msglen,
const unsigned char *sig, unsigned long siglen,
int *stat, const curve25519_key *public_key);
libtomcrypt/src/headers/tomcrypt_pk.h view on Meta::CPAN
int x25519_import_x509(const unsigned char *in, unsigned long inlen, curve25519_key *key);
int x25519_import_pkcs8(const unsigned char *in, unsigned long inlen,
const void *pwd, unsigned long pwdlen,
curve25519_key *key);
int x25519_shared_secret(const curve25519_key *private_key,
const curve25519_key *public_key,
unsigned char *out, unsigned long *outlen);
#endif /* LTC_CURVE25519 */
libtomcrypt/src/headers/tomcrypt_pk.h view on Meta::CPAN
const dsa_key *key);
int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key);
int dsa_export(unsigned char *out, unsigned long *outlen, int type, const dsa_key *key);
int dsa_verify_key(const dsa_key *key, int *stat);
int dsa_shared_secret(void *private_key, void *base,
const dsa_key *public_key,
unsigned char *out, unsigned long *outlen);
#endif /* LTC_MDSA */
#ifdef LTC_DER
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/Libdogecoin/FFI.pm view on Meta::CPAN
is two strings in base-58 encoding. Do not share the private key. Do not lose
the private key.
The public key is a valid P2PKH address.
=head3 C<verify_key_pair( $private_key, $public_key, $is_testnet )>
The boolean C<$is_testnet> argument is optional; the default value is false.
Given two strings in base-58 encoding, returns a boolean value to indicate
whether the pair is valid for the given network.
lib/Finance/Libdogecoin/FFI.pm view on Meta::CPAN
Generates and returns a private/public key hierarchical deterministic pair for
the network. The return value is two strings in base-58 encoding. Do not share
the private key. Do not lose the private key.
=head3 C<generate_derived_hd_pub_key( $master_private_key )>
Given a master key hierarchical deterministic key, derive and return a public
key associated with the master.
=head3 C<verify_master_priv_pub_keypair( $master_private_key, $master_public_key, $is_testnet )>
The boolean C<$is_testnet> argument is optional; the default value is false.
Given two strings representing hierarchical deterministic keys (a master
public key and a master private key) in base-58 encoding, returns a boolean
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Firefox/Marionette.pm view on Meta::CPAN
}
if ( defined $parameters{user} ) {
$parameters{user} =
MIME::Base64::encode_base64url( $parameters{user} );
}
if ( !defined $parameters{private_key} ) {
$parameters{private_key} = {};
}
if ( ref $parameters{private_key} eq 'HASH' ) {
my $script = <<'_JS_';
let privateKeyArguments = {};
if (arguments[0]["name"]) {
privateKeyArguments["name"] = arguments[0]["name"];
} else {
lib/Firefox/Marionette.pm view on Meta::CPAN
return urlSafeKey;
})();
return privateKey;
_JS_
my $old = $self->_context('chrome');
$parameters{private_key} = $self->script(
$self->_compress_script($script),
args => [ $parameters{private_key} ]
);
$self->_context($old);
}
if ( !defined $parameters{sign_count} ) {
$parameters{sign_count} = 0;
lib/Firefox/Marionette.pm view on Meta::CPAN
my %credential_parameters = (
authenticatorId => $authenticator->id(),
credentialId => $parameters{id},
isResidentCredential => $parameters{is_resident},
rpId => $parameters{host},
privateKey => $parameters{private_key},
signCount => $parameters{sign_count},
userHandle => $parameters{user},
);
my $message_id = $self->_new_message_id();
$self->_send_request(
lib/Firefox/Marionette.pm view on Meta::CPAN
=item * id - contains the unique id for this credential, also known as the L<Credential ID|https://www.w3.org/TR/webauthn-2/#credential-id>. If this is not supplied, one will be generated.
=item * is_resident - contains a boolean that if set to true, a L<client-side discoverable credential|https://w3c.github.io/webauthn/#client-side-discoverable-credential> is created. If set to false, a L<server-side credential|https://w3c.github.io/w...
=item * private_key - either a L<RFC5958|https://www.rfc-editor.org/rfc/rfc5958> encoded private key encoded using L<encode_base64url|MIME::Base64::encode_base64url> or a hash containing the following keys;
=over 8
=item * name - contains the name of the private key algorithm, such as "RSA-PSS" (the default), "RSASSA-PKCS1-v1_5", "ECDSA" or "ECDH".
lib/Firefox/Marionette.pm view on Meta::CPAN
$firefox->add_webauthn_credential(
id => $credential->id(),
host => $credential->host(),
user => $credential->user(),
private_key => $credential->private_key(),
is_resident => $credential->is_resident(),
sign_count => $credential->sign_count(),
);
}
$firefox->go('about:blank');
view all matches for this distribution
view release on metacpan or search on metacpan
resources/ssl/cnf/ca.cnf view on Meta::CPAN
default_ca = default_ca
[ default_ca ]
dir = .
certificate = $dir/crt/ca.pem
private_key = $dir/key/ca.pem
certs = $dir/crt # Where the issued certs are kept
serial = $dir/serial # The current serial number
database = $dir/index.txt # database index file.
new_certs_dir = $dir/new # default place for new certs.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Future/IO/TLS.pm view on Meta::CPAN
if (my $hostname = $options{hostname}) {
$ssl->set_verify(Crypt::OpenSSL3::SSL::VERIFY_PEER);
$ssl->set_tlsext_host_name($hostname);
$ssl->set_host($hostname);
}
$ssl->use_PrivateKey_file($options{private_key_file}, Crypt::OpenSSL3::SSL::FILETYPE_PEM) if $options{private_key_file};
$ssl->use_certificate_chain_file($options{certificate_chain_file}) if $options{certificate_chain_file};
my $set_state_method = $options{server} ? 'set_accept_state' : 'set_connect_state';
$ssl->$set_state_method;
lib/Future/IO/TLS.pm view on Meta::CPAN
=item * hostname
The hostname of the other side of the connection. Typically used for client connections.
=item * private_key_file
The location of the private key file. Typically used for server connections.
=item * certificate_chain_file
lib/Future/IO/TLS.pm view on Meta::CPAN
=head2 accept
my $tls = Future::IO::TLS->accept($fh, $sockaddr, %options);
This combines C<< Future::IO->accept >> with C<< Future::IO::TLS->start_TLS >>. You probably want to pass this the C<private_key_file> and C<certificate_chain_file> arguments.
=head2 read
my $data = await $io->read($fh, $size);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Google/Ads/Common/OAuth2ServiceAccountsHandler.pm view on Meta::CPAN
\"iat\":${iat}
}";
my $encoded_header = __encode_base64_url($header);
my $encoded_claims = __encode_base64_url($claims);
my $key = $self->get___crypt_module()->new_private_key($file) || return 0;
$key->use_pkcs1_padding();
$key->use_sha256_hash();
my $signature = $key->sign("${encoded_header}.${encoded_claims}");
my $encoded_signature = __encode_base64_url($signature);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Game/Tibia/Packet/Login.pm view on Meta::CPAN
sub import {
(undef, %params) = (shift, %params, @_);
die "Malformed Tibia version\n" if exists $params{tibia} && $params{tibia} !~ /^\d+$/;
}
my $otserv = Crypt::OpenSSL::RSA->new_private_key(
do { local $/; open my $rsa, '<', dist_file('Game-Tibia-Packet', 'otserv.private') or die "Couldn't open private key $!"; <$rsa>; }
);
=head1 METHODS AND ARGUMENTS
lib/Game/Tibia/Packet/Login.pm view on Meta::CPAN
$self->{versions}{client} = Game::Tibia::Packet::version($self->{version});
if ($self->{versions}{client}{rsa}) {
if (defined $self->{rsa} and !blessed $self->{rsa}) {
$self->{rsa} = Crypt::OpenSSL::RSA->new_private_key($self->{rsa});
}
$self->{rsa}->use_no_padding if defined $self->{rsa};
}
if (defined $self->{packet}) {
lib/Game/Tibia/Packet/Login.pm view on Meta::CPAN
$self->{rsa}->use_no_padding if defined $self->{rsa};
$self->{versions}{client} = Game::Tibia::Packet::version $self->{versions}{client} unless ref $self->{versions}{client};
my $payload = '';
if ($self->{versions}{client}{rsa}) {
$rsa = Crypt::OpenSSL::RSA->new_private_key($rsa) unless blessed $rsa;
$rsa->size == 128
or croak "Protocol $self->{versions}{client}{VERSION} expects 128 bit RSA key, but ${\($rsa->size*8)} bit were provided";
$payload .= "\0";
}
view all matches for this distribution
view release on metacpan or search on metacpan
scripts/find-secret-leakage-in-git-diff.pl view on Meta::CPAN
Sometimes you can't put the mark in the same line. Lines beginning private keys,
for example, do not have room for anything else. In these cases you can skip a
whole block marking its beginning and end like this:
## not a secret leak begin
my $rsa_private_key = <<EOS;
-----BEGIN RSA PRIVATE KEY-----
izfrNTmQLnfsLzi2Wb9xPz2Qj9fQYGgeug3N2MkDuVHwpPcgkhHkJgCQuuvT+qZI
MbS2U6wTS24SZk5RunJIUkitRKeWWMS28SLGfkDs1bBYlSPa5smAd3/q1OePi4ae
<...>
8S86b6zEmkser+SDYgGketS2DZ4hB+vh2ujSXmS8Gkwrn+BfHMzkbtio8lWbGw0l
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Git/Libgit2/FFI.pm view on Meta::CPAN
Create a username/password credential.
=head2 git_credential_ssh_key_new
Git::Libgit2::FFI::git_credential_ssh_key_new(\my $cred, $username, $public_key, $private_key, $passphrase);
Create an SSH key credential.
=head2 git_credential_ssh_key_from_agent
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Git/Native/Credential.pm view on Meta::CPAN
}
sub ssh_key {
my ( $class, %args ) = @_;
my $user = $args{username} // Carp::croak "ssh_key: 'username' required";
my $private_key = $args{private_key} // Carp::croak "ssh_key: 'private_key' required";
my $public_key = $args{public_key}; # may be undef â libgit2 derives
my $passphrase = $args{passphrase} // '';
check_rc Git::Libgit2::FFI::git_credential_ssh_key_new(
\my $cred, $user, $public_key, $private_key, $passphrase,
);
return $class->new( _handle => $cred );
}
sub ssh_agent {
lib/Git/Native/Credential.pm view on Meta::CPAN
# explicit key file
my $cred = Git::Native::Credential->ssh_key(
username => 'git',
public_key => "$ENV{HOME}/.ssh/id_ed25519.pub",
private_key => "$ENV{HOME}/.ssh/id_ed25519",
passphrase => '',
);
=head1 DESCRIPTION
view all matches for this distribution