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
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
lib/Rex/Inline.pm view on Meta::CPAN
use_debug => 0
# now you can set default authentication
user => $user, # optional
password => $password, # optional
public_key => $public_key, # optional
private_key => $private_key,# optional
);
# add default authentication
# if you didn't provide authentication in your task, Rex::Inline will use this as default one
# or if your authentication is failed, Rex::Inline will use this retry the ssh connection
lib/Rex/Inline.pm view on Meta::CPAN
sudo => TRUE,
});
$rex_inline->add_auth({
user => $user,
public_key => $public_key,
private_key => $private_key,
});
# data reference like this
$rex_inline->add_task(
{
lib/Rex/Inline.pm view on Meta::CPAN
server => [@server],
# if need password
password => $password,
# optional
public_key => $public_key,
private_key => $private_key,
}
);
# or Rex::Inline::Test is based on Rex::Inline::Base module
# See Rex::Inline::Base Documents
lib/Rex/Inline.pm view on Meta::CPAN
server => [@server],
# if need password
password => $password,
# optional
public_key => $public_key,
private_key => $private_key,
# input param, in any format you want
input => $input,
)
);
lib/Rex/Inline.pm view on Meta::CPAN
=item password
set default ssh connection password
=item private_key
set default private_key filename
=item public_key
set default public_key filename
=cut
has [qw(user password private_key public_key)] => (is => 'ro', predicate => 1);
=item use_debug
set/get debug option (Bool)
lib/Rex/Inline.pm view on Meta::CPAN
server => [@server2],
# if need password
password => $password2,
# optional
public_key => $public_key2,
private_key => $private_key2,
});
...
=cut
lib/Rex/Inline.pm view on Meta::CPAN
sudo => TRUE,
});
$rex_inline->add_auth({
user => $user,
public_key => $public_key,
private_key => $private_key,
});
=cut
has auth => (
lib/Rex/Inline.pm view on Meta::CPAN
### default auth
my @default_auth;
if ($self->{user}) {
@default_auth = ( user => $self->{user} );
for (qw(password public_key private_key)) {
push @default_auth, $_ => $self->{$_} if $self->{$_};
}
}
$self->add_auth({@default_auth}) if @default_auth;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Rex/JobControl/Helper/Project/Rexfile.pm view on Meta::CPAN
if ( exists $srv_object->{auth}->{public_key} ) {
$ENV{REX_PUBLIC_KEY} = $srv_object->{auth}->{public_key};
}
if ( exists $srv_object->{auth}->{private_key} ) {
$ENV{REX_PRIVATE_KEY} = $srv_object->{auth}->{private_key};
}
if ( exists $srv_object->{auth}->{user} ) {
$ENV{REX_USER} = $srv_object->{auth}->{user};
}
view all matches for this distribution
view release on metacpan or search on metacpan
Rex::connect(
server => "remotehost",
user => "root",
password => "f00b4r",
private_key => "/path/to/private/key/file",
public_key => "/path/to/public/key/file",
);
if(is_file("/foo/bar")) {
print "Do something...\n";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/SPVM/Net/SSLeay/Constant.pm view on Meta::CPAN
C<static method NID_pkcs9_unstructuredName : int ();>
Returns the value of C<NID_pkcs9_unstructuredName>. If this constant is not defined on the system, an exception is thrown with the error id set to the basic type ID of the L<Error::NotSupported|SPVM::Error::NotSupported> class.
=head2 NID_private_key_usage_period
C<static method NID_private_key_usage_period : int ();>
Returns the value of C<NID_private_key_usage_period>. If this constant is not defined on the system, an exception is thrown with the error id set to the basic type ID of the L<Error::NotSupported|SPVM::Error::NotSupported> class.
=head2 NID_rc2_40_cbc
C<static method NID_rc2_40_cbc : int ();>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/STIX/Observable/Type/X509V3Extensions.pm view on Meta::CPAN
'http://raw.githubusercontent.com/oasis-open/cti-stix2-json-schemas/stix2.1/schemas/observables/x509-certificate.json#/definitions/x509-v3-extensions-type';
use constant PROPERTIES => (qw(
basic_constraints name_constraints policy_constraints key_usage extended_key_usage subject_key_identifier
authority_key_identifier subject_alternative_name issuer_alternative_name subject_directory_attributes
crl_distribution_points inhibit_any_policy private_key_usage_period_not_before
private_key_usage_period_not_after certificate_policies policy_mappings
));
has basic_constraints => (is => 'rw', isa => Str);
has name_constraints => (is => 'rw', isa => Str);
has policy_constraints => (is => 'rw', isa => Str);
lib/STIX/Observable/Type/X509V3Extensions.pm view on Meta::CPAN
has issuer_alternative_name => (is => 'rw', isa => Str);
has subject_directory_attributes => (is => 'rw', isa => Str);
has crl_distribution_points => (is => 'rw', isa => Str);
has inhibit_any_policy => (is => 'rw', isa => Str);
has private_key_usage_period_not_before => (
is => 'rw',
isa => InstanceOf ['STIX::Common::Timestamp'],
coerce => sub { ref($_[0]) ? $_[0] : STIX::Common::Timestamp->new($_[0]) },
);
has private_key_usage_period_not_after => (
is => 'rw',
isa => InstanceOf ['STIX::Common::Timestamp'],
coerce => sub { ref($_[0]) ? $_[0] : STIX::Common::Timestamp->new($_[0]) },
);
lib/STIX/Observable/Type/X509V3Extensions.pm view on Meta::CPAN
=item $x509_v3_extensions_type->policy_mappings
Specifies one or more pairs of OIDs; each pair includes an
issuerDomainPolicy and a subjectDomainPolicy
=item $x509_v3_extensions_type->private_key_usage_period_not_after
Specifies the date on which the validity period ends for the private key,
if it is different from the validity period of the certificate.
=item $x509_v3_extensions_type->private_key_usage_period_not_before
Specifies the date on which the validity period begins for the private key,
if it is different from the validity period of the certificate.
=item $x509_v3_extensions_type->subject_alternative_name
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Slovo/Controller/Poruchki.pm view on Meta::CPAN
# POST to Econt to create order
my $_order_struct = $c->_order_struct($o);
my $eco_res = $app->ua->request_timeout(5)->post(
$shop->{crupdate_order_endpoint} =>
{'Content-Type' => 'application/json', Authorization => $shop->{private_key}},
json => $_order_struct
)->res;
$c->debug(
'req_url: ' => $shop->{crupdate_order_endpoint},
' $_order_struct:' => $_order_struct
lib/Slovo/Controller/Poruchki.pm view on Meta::CPAN
# $c->debug('Poruchka:' => $o);
# POST to Econt to create order
my $_order_struct = $c->_order_struct($o);
my $eco_res = $c->app->ua->request_timeout(5)->post(
$shop->{create_awb_endpoint} =>
{'Content-Type' => 'application/json', Authorization => $shop->{private_key}},
json => $_order_struct
)->res;
$c->debug(
'req_url: ' => $shop->{create_awb_endpoint},
' $_order_struct:' => $_order_struct
lib/Slovo/Controller/Poruchki.pm view on Meta::CPAN
# TODO: some logic to use the right shop. We may have multiple
# shops(physical stores) from which we send the orders. For example we may
# choose the shop depending on the IP-location of the user. We want to use
# the closest store to the user to minimise delivery expenses.
# Copy data without private_key.
state $shop = {map { $_ eq 'private_key' ? () : ($_ => $c->config->{shop}{$_}) }
keys %{$c->config->{shop}}};
return $c->render(openapi => $shop);
}
# GET /api/gdpr_consent
view all matches for this distribution
view release on metacpan or search on metacpan
xs/sc_ssl/CTX.pod view on Meta::CPAN
=head2 Functions in alphabetical order
=over
L<check_private_key|Socket::Class::SSL::CTX/check_private_key>,
L<enable_compatibility|Socket::Class::SSL::CTX/enable_compatibility>,
L<new|Socket::Class::SSL::CTX/new>,
L<set_certificate|Socket::Class::SSL::CTX/set_certificate>,
L<set_cipher_list|Socket::Class::SSL::CTX/set_cipher_list>,
L<set_client_ca|Socket::Class::SSL::CTX/set_client_ca>,
L<set_private_key|Socket::Class::SSL::CTX/set_private_key>,
L<set_ssl_method|Socket::Class::SSL::CTX/set_ssl_method>,
L<set_verify_locations|Socket::Class::SSL::CTX/set_verify_locations>,
=back
xs/sc_ssl/CTX.pod view on Meta::CPAN
I<thanks to J. Nick Koston>
use Socket::Class::SSL;
%ssl_args = (
'private_key' => '/path/to/server.key.pem',
'certificate' => '/path/to/server.crt.pem',
'cipher_list' => 'ALL:!ADH:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP'
);
# create shared context
xs/sc_ssl/CTX.pod view on Meta::CPAN
Additional arguments for the constructor.
=for formatter none
certificate Path to certificate file in PEM format
private_key Path to private key file in PEM format
client_ca Path to PEM formatted file with CA certificates
to send to the client
ca_file A file of CA certificates in PEM format
ca_path A directory containing CA certificates in PEM format
ssl_method One of "SSLv2", "SSLv23", "SSLv3" or "TLSv1"
xs/sc_ssl/CTX.pod view on Meta::CPAN
B<Return Values>
Returns a TRUE value on success or UNDEF on failure.
=item B<set_private_key ( $private_key )>
Adds a private key to the socket.
To change a certificate, private key pair the new certificate needs
to be set before setting the private key.
B<Parameters>
=over
=item I<$private_key>
Path to private key file in PEM format.
=back
B<Return Values>
Returns a TRUE value on success or UNDEF on failure.
=item B<check_private_key ()>
Verifies that the private key agrees with the corresponding public key
in the certificate.
Returns a TRUE value on success or UNDEF on failure.
view all matches for this distribution
view release on metacpan or search on metacpan
examples/webservice_example.pl view on Meta::CPAN
use warnings;
use Digest::SHA1 qw(sha1_hex);
use LWP::UserAgent;
my $private_key = '12345';
my $public_id = 'mcrawfor';
my $content = '';
my $host = "http://solstice.washington.edu";
examples/webservice_example.pl view on Meta::CPAN
my $method = "GET";
#build auth key
my $date = localtime;
my $content_sha1 = $content ? sha1_hex($content) : '';
my $to_sign = "$private_key\n$method\n$url\n$date\n$content_sha1";
my $auth_key = "SolAuth $public_id:". sha1_hex($to_sign);
my $ua = LWP::UserAgent->new;
$ua->agent("Solstice Webservices Client/0.1 ");
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Steemit/WsClient.pm view on Meta::CPAN
use Data::Dumper;
has url => 'https://api.steemit.com/';
has ua => sub { Mojo::UserAgent->new };
has posting_key => undef;
has plain_posting_key => \&_transform_private_key;
=head2 all database api methods of the steemit api
L<https://github.com/steemit/steem/blob/master/libraries/app/database_api.cpp>
lib/Steemit/WsClient.pm view on Meta::CPAN
extensions => [],
signatures => [],
};
my $serialized_transaction = $self->_serialize_transaction_message( $transaction );
my $bin_private_key = $self->plain_posting_key;
require Steemit::ECDSA;
my ( $r, $s, $i ) = Steemit::ECDSA::ecdsa_sign( $serialized_transaction, Math::BigInt->from_bytes( $bin_private_key ) );
$i += 4;
$i += 27;
my $signature = join('', map { unpack 'H*', $_ } ( pack("C", $i ), map { $_->as_bytes} ($r,$s )) );
unless( Steemit::ECDSA::is_signature_canonical_canonical( pack "H*", $signature ) ){
lib/Steemit/WsClient.pm view on Meta::CPAN
return $self->{public_posting_key}
}
sub _transform_private_key {
my( $self ) = @_;
die "posting_key missing" unless( $self->posting_key );
my $base58 = $self->posting_key;
require Steemit::Base58;
my $binary = Steemit::Base58::decode_base58( $base58 );
my $version = substr( $binary, 0, 1 );
my $binary_private_key = substr( $binary, 1, -4);
my $checksum = substr( $binary, -4);
die "invalid version in wif ( 0x80 needed ) " unless $version eq pack "H*", '80';
require Digest::SHA;
my $generated_checksum = substr( Digest::SHA::sha256( Digest::SHA::sha256( $version.$binary_private_key )), 0, 4 );
die "invalid checksum " unless $generated_checksum eq $checksum;
return $binary_private_key;
}
sub _serialize_transaction_message {
my ($self,$transaction) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Syntax/Highlight/Engine/Kate/PHP_PHP.pm view on Meta::CPAN
'openssl_public_decrypt',
'openssl_public_encrypt',
'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',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Syntax/Highlight/Universal/hrc/inet/php-gen.hrc view on Meta::CPAN
<word name="openssl_public_encrypt"/>
<word name="openssl_seal"/>
<word name="openssl_sign"/>
<word name="openssl_verify"/>
<word name="openssl_x509_checkpurpose"/>
<word name="openssl_x509_check_private_key"/>
<word name="openssl_x509_export"/>
<word name="openssl_x509_export_to_file"/>
<word name="openssl_x509_free"/>
<word name="openssl_x509_parse"/>
<word name="openssl_x509_read"/>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Syntax/Kamelon/XML/php.xml view on Meta::CPAN
<item>openssl_public_decrypt</item>
<item>openssl_public_encrypt</item>
<item>openssl_seal</item>
<item>openssl_sign</item>
<item>openssl_verify</item>
<item>openssl_x509_check_private_key</item>
<item>openssl_x509_checkpurpose</item>
<item>openssl_x509_export</item>
<item>openssl_x509_export_to_file</item>
<item>openssl_x509_free</item>
<item>openssl_x509_parse</item>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Test/SSH.pm view on Meta::CPAN
Location used to save data bewteen runs (i.e. generated user and host
key pairs).
The default is C<~/.libtest-ssh-perl>
=item private_keys =E<gt> \@key_paths
List of private keys that will be used for login into the remote host.
The default is to look for keys in C<~/.ssh>.
view all matches for this distribution
view release on metacpan or search on metacpan
ext/uid2-client-cpp11/lib/external/httplib.h view on Meta::CPAN
};
#ifdef CPPHTTPLIB_OPENSSL_SUPPORT
class SSLServer : public Server {
public:
SSLServer(const char* cert_path, const char* private_key_path,
const char* client_ca_cert_file_path = nullptr,
const char* client_ca_cert_dir_path = nullptr);
SSLServer(X509* cert, EVP_PKEY* private_key,
X509_STORE* client_ca_cert_store = nullptr);
~SSLServer() override;
bool is_valid() const override;
ext/uid2-client-cpp11/lib/external/httplib.h view on Meta::CPAN
static SSLInit sslinit_;
} // namespace detail
// SSL HTTP server implementation
inline SSLServer::SSLServer(const char* cert_path, const char* private_key_path,
const char* client_ca_cert_file_path,
const char* client_ca_cert_dir_path) {
ctx_ = SSL_CTX_new(SSLv23_server_method());
if (ctx_) {
ext/uid2-client-cpp11/lib/external/httplib.h view on Meta::CPAN
// auto ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
// SSL_CTX_set_tmp_ecdh(ctx_, ecdh);
// EC_KEY_free(ecdh);
if (SSL_CTX_use_certificate_chain_file(ctx_, cert_path) != 1 ||
SSL_CTX_use_PrivateKey_file(ctx_, private_key_path, SSL_FILETYPE_PEM) !=
1) {
SSL_CTX_free(ctx_);
ctx_ = nullptr;
}
else if (client_ca_cert_file_path || client_ca_cert_dir_path) {
ext/uid2-client-cpp11/lib/external/httplib.h view on Meta::CPAN
nullptr);
}
}
}
inline SSLServer::SSLServer(X509* cert, EVP_PKEY* private_key,
X509_STORE* client_ca_cert_store) {
ctx_ = SSL_CTX_new(SSLv23_server_method());
if (ctx_) {
SSL_CTX_set_options(ctx_,
SSL_OP_ALL | SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 |
SSL_OP_NO_COMPRESSION |
SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION);
if (SSL_CTX_use_certificate(ctx_, cert) != 1 ||
SSL_CTX_use_PrivateKey(ctx_, private_key) != 1) {
SSL_CTX_free(ctx_);
ctx_ = nullptr;
}
else if (client_ca_cert_store) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/URI/Amazon/APA.pm view on Meta::CPAN
Title => shift || 'Perl',
SearchIndex => 'Books',
);
$u->sign(
key => $public_key,
secret => $private_key,
);
my $ua = LWP::UserAgent->new;
my $r = $ua->get($u);
if ( $r->is_success ) {
lib/URI/Amazon/APA.pm view on Meta::CPAN
Sings the URI accordingly to the Amazon Product Advertising API.
$u->sign(
key => $public_key,
secret => $private_key,
);
=head2 signature
Checks the signature within the URI;
view all matches for this distribution
view release on metacpan or search on metacpan
clib/tests/lib/test.cc view on Meta::CPAN
assert(err);
err = SSL_CTX_use_PrivateKey_file(ctx, key.c_str(), SSL_FILETYPE_PEM);
assert(err);
err = SSL_CTX_check_private_key(ctx);
assert(err);
return r;
}
string TServer::uri () const {
clib/tests/lib/test.cc view on Meta::CPAN
assert(err);
err = SSL_CTX_use_PrivateKey_file(ctx, key.c_str(), SSL_FILETYPE_PEM);
assert(err);
SSL_CTX_check_private_key(ctx);
assert(err);
SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, nullptr);
SSL_CTX_set_verify_depth(ctx, 4);
view all matches for this distribution
view release on metacpan or search on metacpan
clib/tests/socks.cc view on Meta::CPAN
static SSL_CTX* ctx = nullptr;
if (ctx) return ctx;
ctx = SSL_CTX_new(SSLv23_server_method());
SSL_CTX_use_certificate_file(ctx, "tests/cert/cert.pem", SSL_FILETYPE_PEM);
SSL_CTX_use_PrivateKey_file(ctx, "tests/cert/key.pem", SSL_FILETYPE_PEM);
SSL_CTX_check_private_key(ctx);
return ctx;
}
view all matches for this distribution
view release on metacpan or search on metacpan
clib/tests/cpp_tests.cc view on Meta::CPAN
assert(err);
err = SSL_CTX_use_PrivateKey_file(ctx, key.c_str(), SSL_FILETYPE_PEM);
assert(err);
err = SSL_CTX_check_private_key(ctx);
assert(err);
err = SSL_CTX_load_verify_locations(ctx, cert.c_str(), nullptr);
assert(err);
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/MyTest.pm view on Meta::CPAN
sub get_ssl_ctx {
my $SERV_CERT = "t/cert/ca.pem";
my $serv_ctx = Net::SSLeay::CTX_new();
Net::SSLeay::CTX_use_certificate_file($serv_ctx, $SERV_CERT, &Net::SSLeay::FILETYPE_PEM) or sslerr();
Net::SSLeay::CTX_use_PrivateKey_file($serv_ctx, "t/cert/ca.key", &Net::SSLeay::FILETYPE_PEM) or sslerr();
Net::SSLeay::CTX_check_private_key($serv_ctx) or die Net::SSLeay::ERR_error_string(Net::SSLeay::ERR_get_error);
return $serv_ctx unless wantarray();
my $client_ctx = Net::SSLeay::CTX_new();
Net::SSLeay::CTX_load_verify_locations($client_ctx, $SERV_CERT, '') or die "something went wrong";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/VAPID.pm view on Meta::CPAN
generate_vapid_keys => [qw/all generate/],
generate_future_expiration_timestamp => [qw/all generate/],
generate_vapid_header => [qw/all generate/],
validate_subject => [qw/all validate/],
validate_public_key => [qw/all validate/],
validate_private_key => [qw/all validate/],
validate_expiration_key => [qw/all validate/],
validate_expiration => [qw/all validate/],
);
}
lib/VAPID.pm view on Meta::CPAN
die "VAPID audience is not a url.";
}
validate_subject($subject);
validate_public_key($pub);
$priv = validate_private_key($priv);
if ($expiration) {
validate_expiration($expiration);
} else {
$expiration = generate_future_expiration_timestamp();
lib/VAPID.pm view on Meta::CPAN
}
return $pub;
}
sub validate_private_key {
my ($priv) = shift;
if (!$priv) {
die "No private key passed to validate_private_key";
}
if (ref $priv) {
die "VAPID private key is must be a URL safe Base 64 encoded string";
}
lib/VAPID.pm view on Meta::CPAN
use VAPID qw/generate/;
my ($public, $private) = generate_vapid_keys()
validate_public_key($public);
validate_private_key($private);
...
my $auth_headers = generate_vapid_header(
'https://updates.push.services.mozilla.com',
lib/VAPID.pm view on Meta::CPAN
=head2 validate_public_key
Validate the public key.
=head2 validate_private_key
Validate the private key.
=head2 validate_expiration
view all matches for this distribution
view release on metacpan or search on metacpan
bin/sync_to_snapshot.pl view on Meta::CPAN
# Create a temporary key for ssh'ing
print STDERR "Creating a temporary ssh key...\n";
my $keypairname = "${Program_name}_$$";
$KeyFile = File::Spec->catfile(File::Spec->tmpdir,"$keypairname.pem");
$KeyPair = $ec2->create_key_pair($keypairname);
my $private_key = $KeyPair->privateKey;
open my $k,'>',$KeyFile or die "Couldn't create $KeyFile: $!";
chmod 0600,$KeyFile or die "Couldn't chmod $KeyFile: $!";
print $k $private_key;
close $k;
# Create a temporary security group for ssh'ing
print STDERR "Creating a temporary security group with ssh enabled...\n";
$Group = $ec2->create_security_group(-name => "${Program_name}_$$",
view all matches for this distribution
view release on metacpan or search on metacpan
lib/VM/HetznerCloud/API/Certificates.pm view on Meta::CPAN
=head2 create
Creates a new Certificate.
The default type **uploaded** allows for uploading your existing `certificate` and `private_key` in PEM format. You have to monitor its expiration date and handle renewal yourself.
In contrast, type **managed** requests a new Certificate from *Let's Encrypt* for the specified `domain_names`. Only domains managed by *Hetzner DNS* are supported. We handle renewal and timely alert the project owner via email if problems occur.
For type `managed` Certificates the `action` key of the response contains the Action that allows for tracking the issuance process. For type `uploaded` Certificates the `action` is always null.
view all matches for this distribution
view release on metacpan or search on metacpan
WSFC_wrap.c view on Meta::CPAN
}
void wsf_set_security_data_to_rampart_context(axutil_env_t *env,
rampart_context_t *rampart_context,
axis2_char_t *private_key,
axis2_char_t *certificate,
axis2_char_t *receiver_certificate,
axis2_char_t *user,
axis2_char_t *password,
axis2_char_t *password_type,
int ttl)
{
if (NULL != private_key) {
if (rampart_context_set_prv_key(rampart_context, env, (void *) private_key) == AXIS2_SUCCESS)
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[wsf_sec_policy] setting pvt key ");
if (rampart_context_set_prv_key_type(rampart_context, env, AXIS2_KEY_TYPE_PEM) == AXIS2_SUCCESS)
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[wsf_sec_policy] setting pvt key format ");
}
WSFC_wrap.c view on Meta::CPAN
void handle_client_security(axutil_env_t *env,
axis2_svc_client_t *svc_client,
axiom_node_t *incoming_policy_node,
axis2_char_t *private_key,
axis2_char_t *certificate,
axis2_char_t *receiver_certificate,
axis2_char_t *user,
axis2_char_t *password,
axis2_char_t *password_type,
WSFC_wrap.c view on Meta::CPAN
conf_ctx = axis2_svc_ctx_get_conf_ctx(svc_ctx, env);
if (NULL != conf_ctx) {
conf = axis2_conf_ctx_get_conf(conf_ctx, env);
if (NULL != conf) {
rampart_ctx = rampart_context_create(env);
wsf_set_security_data_to_rampart_context(env, rampart_ctx, private_key, certificate, receiver_certificate, user, password, password_type, ttl);
security_param = axutil_param_create(env, (axis2_char_t *) WSF_RAMPART_CONFIGURATION, rampart_ctx);
if (NULL != security_param)
axis2_conf_add_param(conf, env, security_param);
}
}
WSFC_wrap.c view on Meta::CPAN
int ecode9 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 9) || (items > 9)) {
SWIG_croak("Usage: wsf_set_security_data_to_rampart_context(env,rampart_context,private_key,certificate,receiver_certificate,user,password,password_type,ttl);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_axutil_env_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "wsf_set_security_data_to_rampart_context" "', argument " "1"" of type '" "axutil_env_t *""'");
}
WSFC_wrap.c view on Meta::CPAN
int ecode10 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 10) || (items > 10)) {
SWIG_croak("Usage: handle_client_security(env,svc_client,incoming_policy_node,private_key,certificate,receiver_certificate,user,password,password_type,ttl);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_axutil_env_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "handle_client_security" "', argument " "1"" of type '" "axutil_env_t *""'");
}
WSFC_wrap.c view on Meta::CPAN
sv_setsv(sv, SWIG_FromCharPtr("SSL_PASSPHRASE"));
SvREADONLY_on(sv);
} while(0) /*@SWIG@*/;
/*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "WSF_SEC_TOK_OPT_PRIVATE_KEY", TRUE | 0x2);
sv_setsv(sv, SWIG_FromCharPtr("private_key"));
SvREADONLY_on(sv);
} while(0) /*@SWIG@*/;
/*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "WSF_SEC_TOK_OPT_CERT", TRUE | 0x2);
sv_setsv(sv, SWIG_FromCharPtr("certificate"));
view all matches for this distribution
view release on metacpan or search on metacpan
lib/WSRF/Lite.pm view on Meta::CPAN
$ENV{HTTPS_KEY_FILE} ? $ENV{HTTPS_KEY_FILE} : die "No Private Key\n";
open( PRIVKEY, $key_file_name )
|| die("Could not open file $key_file_name");
my $privkey = join "", <PRIVKEY>;
close(PRIVKEY);
Crypt::OpenSSL::RSA->new_private_key($privkey);
}
#returns the cert block between the begin and end delimiters
sub load_cert {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/WWW/FCM/HTTP/V1/OAuth.pm view on Meta::CPAN
my ($json, $scopes) = @_;
my $secret = decode_json($json);
return +{
client_email => $secret->{client_email},
private_key => $secret->{private_key},
private_key_id => $secret->{private_key_id},
scopes => $scopes,
token_url => $secret->{token_url} || $DEFAULT_TOKEN_URL,
};
}
sub get_token {
my ($self, %args) = @_;
my $cache_key = $self->jwt_config->{private_key_id};
if ($self->cache) {
if ($args{force_refresh}) {
$self->cache->delete($cache_key);
} else {
my $token_cache = $self->cache->get($cache_key);
return $token_cache if $token_cache;
}
}
my $claims = $self->_construct_claims($self->jwt_config);
my $jwt = JSON::WebToken->encode($claims, $self->jwt_config->{private_key}, 'RS256');
my $res = $self->ua->post(
$self->token_url,
['Content-Type' => 'application/x-www-form-urlencoded'],
['grant_type' => $self->grant_type, assertion => $jwt],
);
view all matches for this distribution
view release on metacpan or search on metacpan
=head1 SYNOPSIS
use WWW::Facebook::FQL;
## Connect and log in:
my $fb = new WWW::Facebook::FQL key => $public_key, private => $private_key;
$fb->login($email, $password);
## Get your own name and pic back:
$fb->query("SELECT name, pic FROM user WHERE uid=$fb->{uid}");
view all matches for this distribution
view release on metacpan or search on metacpan
lib/WWW/Google/Cloud/Auth/ServiceAccount.pm view on Meta::CPAN
scope => $self->scope,
aud => 'https://www.googleapis.com/oauth2/v4/token',
exp => $self->clock->() + 600,
iat => $self->clock->(),
};
my $key = $creds->{private_key};
return encode_jwt(alg => 'RS256', payload => $payload, key => \$key);
}
sub get_token {
my $self = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/WWW/Google/Drive.pm view on Meta::CPAN
my $config = Config::JSON->new($self->secret_json);
my $time = time;
my $service_acc_id = $config->get("client_email");
my $private_key_string = $config->get("private_key");
my $jwt = JSON::WebToken->encode(
{
iss => $service_acc_id,
scope => $self->scope,
lib/WWW/Google/Drive.pm view on Meta::CPAN
iat => $time,
# Access files from this users drive/ impersonate user
prn => $self->user_as,
},
$private_key_string,
'RS256',
{typ => 'JWT'}
);
# Authenticate via post, and get a token
view all matches for this distribution