view release on metacpan or search on metacpan
lib/Google/Iam/Admin/V1/Iam.pm view on Meta::CPAN
# Field: public_key_type Type: 14 (.google.iam.admin.v1.ServiceAccountPublicKeyType)
# === Message: Google::Iam::Admin::V1::Iam::ServiceAccountKey ===
# Fields for ServiceAccountKey
# Field: name Type: 9 ()
# Field: private_key_type Type: 14 (.google.iam.admin.v1.ServiceAccountPrivateKeyType)
# Field: key_algorithm Type: 14 (.google.iam.admin.v1.ServiceAccountKeyAlgorithm)
# Field: private_key_data Type: 12 ()
# Field: public_key_data Type: 12 ()
# Field: valid_after_time Type: 11 (.google.protobuf.Timestamp)
# Field: valid_before_time Type: 11 (.google.protobuf.Timestamp)
# Field: key_origin Type: 14 (.google.iam.admin.v1.ServiceAccountKeyOrigin)
# Field: key_type Type: 14 (.google.iam.admin.v1.ListServiceAccountKeysRequest.KeyType)
# Field: disabled Type: 8 ()
# === Message: Google::Iam::Admin::V1::Iam::CreateServiceAccountKeyRequest ===
# Fields for CreateServiceAccountKeyRequest
# Field: name Type: 9 ()
# Field: private_key_type Type: 14 (.google.iam.admin.v1.ServiceAccountPrivateKeyType)
# Field: key_algorithm Type: 14 (.google.iam.admin.v1.ServiceAccountKeyAlgorithm)
# === Message: Google::Iam::Admin::V1::Iam::UploadServiceAccountKeyRequest ===
# Fields for UploadServiceAccountKeyRequest
# Field: name Type: 9 ()
lib/Google/Iam/Admin/V1/Iam.pm view on Meta::CPAN
Type: C<String>
The resource name of the service account key in the following format
`projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`.
=item * C<< $msg->private_key_type() >> / C<< $msg->private_key_type($value) >>
Type: C<Enum> (L<Google::Iam::Admin::V1::ServiceAccountPrivateKeyType>)
The output format for the private key.
Only provided in `CreateServiceAccountKey` responses, not
lib/Google/Iam/Admin/V1/Iam.pm view on Meta::CPAN
Type: C<Enum> (L<Google::Iam::Admin::V1::ServiceAccountKeyAlgorithm>)
Specifies the algorithm (and possibly key size) for the key.
=item * C<< $msg->private_key_data() >> / C<< $msg->private_key_data($value) >>
Type: C<Bytes>
The private key data. Only provided in `CreateServiceAccountKey`
responses. Make sure to keep the private key data secure because it
lib/Google/Iam/Admin/V1/Iam.pm view on Meta::CPAN
`projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.
Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
the account. The `ACCOUNT` value can be the `email` address or the
`unique_id` of the service account.
=item * C<< $msg->private_key_type() >> / C<< $msg->private_key_type($value) >>
Type: C<Enum> (L<Google::Iam::Admin::V1::ServiceAccountPrivateKeyType>)
The output format of the private key. The default value is
`TYPE_GOOGLE_CREDENTIALS_FILE`, which is the Google Credentials File
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Google/Cloud/Oracledatabase/V1/GoldengateConnection.pm view on Meta::CPAN
# Fields for GoldengateOciObjectStorageConnectionProperties
# Field: technology_type Type: 9 ()
# Field: tenancy_id Type: 9 ()
# Field: region Type: 9 ()
# Field: user_id Type: 9 ()
# Field: private_key_file Type: 9 ()
# Field: private_key_passphrase_secret Type: 9 ()
# Field: public_key_fingerprint Type: 9 ()
# Field: use_resource_principal Type: 8 ()
# === Message: Google::Cloud::Oracledatabase::V1::GoldengateConnection::GoldengateAzureDataLakeStorageConnectionProperties ===
# Fields for GoldengateAzureDataLakeStorageConnectionProperties
lib/Google/Cloud/Oracledatabase/V1/GoldengateConnection.pm view on Meta::CPAN
# Fields for GoldengateOracleNosqlConnectionProperties
# Field: technology_type Type: 9 ()
# Field: tenancy_id Type: 9 ()
# Field: region Type: 9 ()
# Field: user_id Type: 9 ()
# Field: private_key_file Type: 9 ()
# Field: private_key_passphrase_secret Type: 9 ()
# Field: public_key_fingerprint Type: 9 ()
# Field: use_resource_principal Type: 8 ()
# === Message: Google::Cloud::Oracledatabase::V1::GoldengateConnection::GoldengateSnowflakeConnectionProperties ===
# Fields for GoldengateSnowflakeConnectionProperties
lib/Google/Cloud/Oracledatabase/V1/GoldengateConnection.pm view on Meta::CPAN
# Field: password_secret_version Type: 9 ()
# Field: technology_type Type: 9 ()
# Field: connection_url Type: 9 ()
# Field: authentication_type Type: 14 (.google.cloud.oracledatabase.v1.GoldengateSnowflakeConnectionProperties.AuthenticationType)
# Field: username Type: 9 ()
# Field: private_key_file Type: 9 ()
# Field: private_key_passphrase_secret Type: 9 ()
# Enum: GoldengateSnowflakeConnectionProperties::AuthenticationType
our $GoldengateSnowflakeConnectionProperties_AUTHENTICATION_TYPE_UNSPECIFIED = 0;
our $GoldengateSnowflakeConnectionProperties_BASIC = 1;
our $GoldengateSnowflakeConnectionProperties_KEY_PAIR = 2;
lib/Google/Cloud/Oracledatabase/V1/GoldengateConnection.pm view on Meta::CPAN
# Field: technology_type Type: 9 ()
# Field: connection_url Type: 9 ()
# Field: tenancy_id Type: 9 ()
# Field: region Type: 9 ()
# Field: user_id Type: 9 ()
# Field: private_key_file Type: 9 ()
# Field: private_key_passphrase_secret Type: 9 ()
# Field: public_key_fingerprint Type: 9 ()
# Field: use_resource_principal Type: 8 ()
# === Message: Google::Cloud::Oracledatabase::V1::GoldengateConnection::GlueIcebergCatalog ===
# Fields for GlueIcebergCatalog
lib/Google/Cloud/Oracledatabase/V1/GoldengateConnection.pm view on Meta::CPAN
Type: C<String>
Optional. The OCID of the OCI user who will access the Object Storage.
The user must have write access to the bucket they want to connect to.
=item * C<< $msg->private_key_file() >> / C<< $msg->private_key_file($value) >>
Type: C<String>
Optional. The content of the private key file (PEM file)
corresponding to the API key of the fingerprint.
=item * C<< $msg->private_key_passphrase_secret() >> / C<< $msg->private_key_passphrase_secret($value) >>
Type: C<String>
Optional. The passphrase of the private key.
lib/Google/Cloud/Oracledatabase/V1/GoldengateConnection.pm view on Meta::CPAN
Type: C<String>
Optional. The OCID of the OCI user who will access the Oracle NoSQL
database.
=item * C<< $msg->private_key_file() >> / C<< $msg->private_key_file($value) >>
Type: C<String>
Optional. The content of the private key file (PEM file)
corresponding to the API key of the fingerprint.
=item * C<< $msg->private_key_passphrase_secret() >> / C<< $msg->private_key_passphrase_secret($value) >>
Type: C<String>
Optional. The passphrase of the private key.
lib/Google/Cloud/Oracledatabase/V1/GoldengateConnection.pm view on Meta::CPAN
Type: C<String>
Optional. The username Oracle Goldengate uses to connect to Snowflake.
=item * C<< $msg->private_key_file() >> / C<< $msg->private_key_file($value) >>
Type: C<String>
Optional. The content of private key file in PEM format.
=item * C<< $msg->private_key_passphrase_secret() >> / C<< $msg->private_key_passphrase_secret($value) >>
Type: C<String>
Optional. Password if the private key file is encrypted.
lib/Google/Cloud/Oracledatabase/V1/GoldengateConnection.pm view on Meta::CPAN
Type: C<String>
Optional. The OCID of the OCI user who will access.
=item * C<< $msg->private_key_file() >> / C<< $msg->private_key_file($value) >>
Type: C<String>
Optional. The content of the private key file (PEM file)
corresponding to the API key of the fingerprint.
=item * C<< $msg->private_key_passphrase_secret() >> / C<< $msg->private_key_passphrase_secret($value) >>
Type: C<String>
Optional. The passphrase of the private key.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Google/Cloud/Oslogin/V1beta/Oslogin.pm view on Meta::CPAN
# Field: update_mask Type: 11 (.google.protobuf.FieldMask)
# === Message: Google::Cloud::Oslogin::V1beta::Oslogin::SecurityKey ===
# Fields for SecurityKey
# Field: public_key Type: 9 ()
# Field: private_key Type: 9 ()
# Field: universal_two_factor Type: 11 (.google.cloud.oslogin.v1beta.UniversalTwoFactor)
# Field: web_authn Type: 11 (.google.cloud.oslogin.v1beta.WebAuthn)
# Field: device_nickname Type: 9 ()
# === Message: Google::Cloud::Oslogin::V1beta::Oslogin::UniversalTwoFactor ===
lib/Google/Cloud/Oslogin/V1beta/Oslogin.pm view on Meta::CPAN
Type: C<String>
Public key text in SSH format, defined by
[RFC4253]("https://www.ietf.org/rfc/rfc4253.txt") section 6.6.
=item * C<< $msg->private_key() >> / C<< $msg->private_key($value) >>
Type: C<String>
Hardware-backed private key text in SSH format.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Google/Cloud/Recaptchaenterprise/V1/Recaptchaenterprise.pm view on Meta::CPAN
# === Message: Google::Cloud::Recaptchaenterprise::V1::Recaptchaenterprise::UniversalKeySettings ===
# Fields for UniversalKeySettings
# === Message: Google::Cloud::Recaptchaenterprise::V1::Recaptchaenterprise::AppleDeveloperId ===
# Fields for AppleDeveloperId
# Field: private_key Type: 9 ()
# Field: key_id Type: 9 ()
# Field: team_id Type: 9 ()
# === Message: Google::Cloud::Recaptchaenterprise::V1::Recaptchaenterprise::ScoreDistribution ===
# Fields for ScoreDistribution
lib/Google/Cloud/Recaptchaenterprise/V1/Recaptchaenterprise.pm view on Meta::CPAN
=head3 Accessors
=over 4
=item * C<< $msg->private_key() >> / C<< $msg->private_key($value) >>
Type: C<String>
Required. Input only. A private key (downloaded as a text file with a .p8
file extension) generated for your Apple Developer account. Ensure that
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Google/Cloud/Sql/V1/CloudSqlResources.pm view on Meta::CPAN
# Field: self_link Type: 9 ()
# === Message: Google::Cloud::Sql::V1::CloudSqlResources::SslCertDetail ===
# Fields for SslCertDetail
# Field: cert_info Type: 11 (.google.cloud.sql.v1.SslCert)
# Field: cert_private_key Type: 9 ()
# === Message: Google::Cloud::Sql::V1::CloudSqlResources::DNSEntry ===
# Fields for DNSEntry
# Field: dns Type: 9 ()
# Field: ipv4_address Type: 9 ()
lib/Google/Cloud/Sql/V1/CloudSqlResources.pm view on Meta::CPAN
Type: C<Message> (L<Google::Cloud::Sql::V1::CloudSqlResources::SslCert>)
The public information about the cert.
=item * C<< $msg->cert_private_key() >> / C<< $msg->cert_private_key($value) >>
Type: C<String>
The private key for the client cert, in pem format. Keep private in order
to protect your security.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Google/Cloud/Sql/V1beta4/CloudSqlResources.pm view on Meta::CPAN
# Field: self_link Type: 9 ()
# === Message: Google::Cloud::Sql::V1beta4::CloudSqlResources::SslCertDetail ===
# Fields for SslCertDetail
# Field: cert_info Type: 11 (.google.cloud.sql.v1beta4.SslCert)
# Field: cert_private_key Type: 9 ()
# === Message: Google::Cloud::Sql::V1beta4::CloudSqlResources::DNSEntry ===
# Fields for DNSEntry
# Field: dns Type: 9 ()
# Field: ipv4_address Type: 9 ()
lib/Google/Cloud/Sql/V1beta4/CloudSqlResources.pm view on Meta::CPAN
Type: C<Message> (L<Google::Cloud::Sql::V1beta4::CloudSqlResources::SslCert>)
The public information about the cert.
=item * C<< $msg->cert_private_key() >> / C<< $msg->cert_private_key($value) >>
Type: C<String>
The private key for the client cert, in pem format. Keep private in order
to protect your security.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Google/Cloud/Video/Stitcher/V1/CdnKeys.pm view on Meta::CPAN
# Field: name Type: 9 ()
# Field: hostname Type: 9 ()
# === Message: Google::Cloud::Video::Stitcher::V1::CdnKeys::GoogleCdnKey ===
# Fields for GoogleCdnKey
# Field: private_key Type: 12 ()
# Field: key_name Type: 9 ()
# === Message: Google::Cloud::Video::Stitcher::V1::CdnKeys::AkamaiCdnKey ===
# Fields for AkamaiCdnKey
# Field: token_key Type: 12 ()
# === Message: Google::Cloud::Video::Stitcher::V1::CdnKeys::MediaCdnKey ===
# Fields for MediaCdnKey
# Field: private_key Type: 12 ()
# Field: key_name Type: 9 ()
# Field: token_config Type: 11 (.google.cloud.video.stitcher.v1.MediaCdnKey.TokenConfig)
1;
lib/Google/Cloud/Video/Stitcher/V1/CdnKeys.pm view on Meta::CPAN
=head3 Accessors
=over 4
=item * C<< $msg->private_key() >> / C<< $msg->private_key($value) >>
Type: C<Bytes>
Input only. Secret for this Google Cloud CDN key.
lib/Google/Cloud/Video/Stitcher/V1/CdnKeys.pm view on Meta::CPAN
=head3 Accessors
=over 4
=item * C<< $msg->private_key() >> / C<< $msg->private_key($value) >>
Type: C<Bytes>
Input only. 64-byte ed25519 private key for this Media CDN key.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Google/ContentAPI.pm view on Meta::CPAN
scope => $gapiContentScope,
aud => $gapiTokenURI,
exp => $time + 3660, # max 60 minutes
iat => $time
},
key => \$self->{config}->{private_key},
alg => 'RS256'
);
# 2) Request an access token
#
lib/Google/ContentAPI.pm view on Meta::CPAN
{
"endpoint": "https://www.googleapis.com/content/v2.1",
"merchant_id": "123456789",
"type": "service_account",
"project_id": "content-api-194321",
"private_key_id": "11b8e20c2540c788e98b49e623ae8167dc3e4a6f",
"private_key": "-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----\n",
"client_email": "google@content-api.iam.gserviceaccount.com",
"client_id": "999999999",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Google/SAML/Response.pm view on Meta::CPAN
sub _load_rsa_key {
my $self = shift;
my $key_text = shift;
my $rsa_key = Crypt::OpenSSL::RSA->new_private_key( $key_text );
if ( $rsa_key ) {
$self->{ key_obj } = $rsa_key;
my $big_num = ( $rsa_key->get_key_parameters )[ 1 ];
view all matches for this distribution
view release on metacpan or search on metacpan
ext/channel_credentials.xs view on Meta::CPAN
if ( items % 2 ) {
croak("Expecting a hash as input to channel credentials constructor");
}
// @param string pem_root_certs PEM encoding of the server root certificates
// @param string pem_private_key PEM encoding of the client's private key
// (optional)
// @param string pem_cert_chain PEM encoding of the client's certificate chain
// (optional)
// @return ChannelCredentials The new SSL credentials object
const char* pem_root_certs = NULL;
grpc_ssl_pem_key_cert_pair pem_key_cert_pair;
pem_key_cert_pair.private_key = pem_key_cert_pair.cert_chain = NULL;
int i;
for (i = 0; i < items; i += 2 ) {
const char *key = SvPV_nolen(ST(i));
if (!strcmp( key, "pem_root_certs")) {
if (SvOK(ST(i+1)))
pem_root_certs = SvPV_nolen(ST(i+1));
} else if (!strcmp( key, "pem_private_key")) {
if (SvOK(ST(i+1)))
pem_key_cert_pair.private_key = SvPV_nolen(ST(i+1));
} else if (!strcmp( key, "pem_cert_chain")) {
if (SvOK(ST(i+1)))
pem_key_cert_pair.cert_chain = SvPV_nolen(ST(i+1));
}
}
ctx->wrapped = grpc_ssl_credentials_create(
pem_root_certs,
pem_key_cert_pair.private_key == NULL ? NULL : &pem_key_cert_pair, NULL
#ifdef GRPC_SSL_CREDENTIALS_HAS_4_ARGS
, NULL
#endif
);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HEAT/Crypto.pm view on Meta::CPAN
use Carp;
use HEAT::Crypto::X25519;
use Crypt::Mode::CBC;
use Exporter qw(import);
our @EXPORT_OK = qw(hash heat_key get_private_key keygen priv_to_pub_key
shared_key sign verify encrypt decrypt account_id random_bytes tohex unhex);
our $VERSION = '0.04';
my $cbc = Crypt::Mode::CBC->new('AES');
lib/HEAT/Crypto.pm view on Meta::CPAN
} else {
croak('invalid key spec: %q', $spec);
}
}
sub get_private_key($)
{
my $spec = shift;
if ($spec =~ /^([a-z]{3,12}( |\Z)){12}$/) {
return HEAT::Crypto::X25519::keyhash($spec);
lib/HEAT/Crypto.pm view on Meta::CPAN
}
}
sub priv_to_pub_key($)
{
my $p = get_private_key($_[0]);
my $r = HEAT::Crypto::X25519::keygen($p);
return tohex($r->{p});
}
sub account_id($)
lib/HEAT/Crypto.pm view on Meta::CPAN
};
}
sub shared_key($$)
{
my $k = get_private_key($_[0]);
my $p = heat_key($_[1]);
return tohex(HEAT::Crypto::X25519::shared($k, $p));
}
sub sign($$)
{
my $k = get_private_key($_[0]);
my $msg = $_[1];
return tohex(HEAT::Crypto::X25519::sign($k, $msg));
}
sub verify($$$)
lib/HEAT/Crypto.pm view on Meta::CPAN
p => <public key bytes>,
k => <private key bytes>,
s => <signing key bytes>,
}
=item shared_key( $private_key, $public_key );
Compute shared secret.
Returns the key as a hexadecimal string.
=item sign( $private_key, $message );
Sign message with the private key.
Returns the signature as a hexadecimal string.
lib/HEAT/Crypto.pm view on Meta::CPAN
Decrypts data with the given key. Data is expected to be returned by encrypt();
It returns the decrypted data on success. This function might die in case of errors.
=item priv_to_pub_key( $private_key )
Derives the public key from the private key.
Returns the public key as a hexadecimal string.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HEAT/Crypto.pm view on Meta::CPAN
p => <public key bytes>,
k => <private key bytes>,
s => <signing key bytes>,
}
=item shared_key( $private_key, $public_key );
Computes shared secret.
Returns the key bytes.
=item sign( $private_key, $message );
Sign message with the private key.
Returns the signature bytes.
lib/HEAT/Crypto.pm view on Meta::CPAN
Decrypts data with the given key. Data is expected to be in the format returned
by encrypt();
It returns the decrypted data on success or undefined in case of failure.
=item priv_to_pub_key( $private_key )
Derives the public key from the private key.
=item account_id( $public_key )
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTML/FormFu/Constraint/reCAPTCHA.pm view on Meta::CPAN
= blessed($query)
&& $query->can('secure')
&& $query->can('address');
my $captcha = Captcha::reCAPTCHA->new;
my $privkey = $self->parent->private_key || $ENV{RECAPTCHA_PRIVATE_KEY};
my $remoteip
= $catalyst_compatible
? $query->address
: $ENV{REMOTE_ADDR};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTML/FormHandlerX/Field/reCAPTCHA.pm view on Meta::CPAN
our $AUTHORITY = 'cpan:JJNAPIORK';
has '+widget' => ( default => 'reCAPTCHA' );
has '+input_param' => ( default => 'recaptcha_response_field' );
has [qw/public_key private_key/] => (is=>'rw', isa=>'Str', lazy_build=>1);
has 'use_ssl' => (is=>'rw', isa=>'Bool', required=>1, default=>0);
has 'remote_address' => (is=>'rw', isa=>'Str', lazy_build=>1);
has 'recaptcha_options' => (is=>'rw', isa=>'HashRef', required=>1, default=>sub{ +{} });
has 'recaptcha_message' => (is=>'rw', isa=>'Str', default=>'Error validating reCAPTCHA');
has 'recaptcha_instance' => (is=>'ro', init_arg=>undef, lazy_build=>1);
lib/HTML/FormHandlerX/Field/reCAPTCHA.pm view on Meta::CPAN
} else {
die "You either have to set the 'public_key' field option or defined a $method method in your form!";
}
}
sub _build_private_key {
my $self = shift @_;
my $form = $self->form;
my $method = $self->name.'_private_key';
if ($form->can($method)) {
return $form->$method;
} else {
die "You either have to set the 'private_key' field option or defined a $method method in your form!";
}
}
sub _build_encrypter {
my $self = shift @_;
my $key = pack("H16",$self->private_key);
return Crypt::CBC->new(-key=>$key,-cipher=>"Blowfish");
}
sub _build_remote_address {
$ENV{REMOTE_ADDR};
lib/HTML/FormHandlerX/Field/reCAPTCHA.pm view on Meta::CPAN
}
sub prepare_private_recaptcha_args {
my $self = shift @_;
return (
$self->private_key,
$self->prepare_recaptcha_args,
);
}
sub prepare_recaptcha_args {
lib/HTML/FormHandlerX/Field/reCAPTCHA.pm view on Meta::CPAN
In your L<HTML::FormHandler> subclass, "MyApp::HTML::Forms::MyForm":
has_field 'recaptcha' => (
type=>'reCAPTCHA',
public_key=>'[YOUR PUBLIC KEY]',
private_key=>'[YOUR PRIVATE KEY]',
recaptcha_message => "You're failed to prove your Humanity!",
required=>1,
);
Example L<Catalyst> controller:
lib/HTML/FormHandlerX/Field/reCAPTCHA.pm view on Meta::CPAN
=head2 public_key
The public key you get when you create an account on L<http://recaptcha.net/>
=head2 private_key
The private key you get when you create an account on L<http://recaptcha.net/>
=head2 use_ssl
lib/HTML/FormHandlerX/Field/reCAPTCHA.pm view on Meta::CPAN
=head1 FORM METHODS
The following methods or attributes can be set in the form which contains the
recapcha field.
=head2 $name_public_key or $name_private_key
"$name" is the name you gave to the reCAPTCHA field (the word directy after the
"has_field" command.
You may wish to set your public key from a method or attribute contained from
within the form. This would make it easier to have one form class and use
configuration tools, such as what L<Catalyst> offers, to set the pubic key.
For example:
## In my form "MyApp::Form::MyForm
has ['MY_recaptcha_public_key', 'MY_recapcha_private_key'] => (
is=>'ro', isa=>'Str', required=>1,
);
has_field 'MY_recaptcha' => (
type=>'reCAPTCHA',
recaptcha_message => "You're failed to prove your Humanity!",
lib/HTML/FormHandlerX/Field/reCAPTCHA.pm view on Meta::CPAN
Then you might construct this in a L<Catalyst::Controller>:
my $form = MyApp::Form::MyForm->new(
MY_recaptcha_public_key => $self->controller_public_key,
MY_recaptcha_private_key => $self->controller_private_key,
);
## 'process', etc.
Then your controller could populate the attributes 'controller_public_key' and
'controller_private_key' from your global L<Catalyst> configuration, allowing
you to use one set of keys in development and another for production, or even
use different keys for different forms if you wish.
=head1 SEE ALSO
view all matches for this distribution
view release on metacpan or search on metacpan
t/function.t view on Meta::CPAN
is($m->{tile_url}, 'https://tiles.internal/{z}/{x}/{y}.png', 'tile_url overridden');
};
subtest 'new: clone merges overrides, skips validation, is a distinct object' => sub {
my $base = HTML::OSM->new(zoom => 5);
my $clone = $base->new(zoom => 9, _private_key => 'val');
isa_ok($clone, 'HTML::OSM', 'clone isa HTML::OSM');
is($clone->{zoom}, 9, 'clone zoom updated');
is($clone->{height}, $CFG{DEFAULT_HEIGHT}, 'clone inherits height');
is($clone->{_private_key}, 'val', 'arbitrary key passes clone (no validation)');
isnt(refaddr($clone), refaddr($base), 'clone is a distinct reference');
returns_ok($clone, { type => 'object', isa => 'HTML::OSM' }, 'clone returns HTML::OSM');
};
subtest 'new: cache default is an object with get/set' => sub {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/PublicKeyPins.pm view on Meta::CPAN
/^[-]{5}BEGIN[ ](?:RSA[ ])?(PUBLIC|PRIVATE)[ ]KEY[-]{5}/smx )
{
my ($type) = ($1);
if ( $type eq 'PRIVATE' ) {
$pem_encoded_public_key_string =
_process_pem_private_key( $handle, $file_header, $path );
}
else {
$pem_encoded_public_key_string =
_process_pem_public_key( $handle, $file_header, $path );
}
lib/HTTP/PublicKeyPins.pm view on Meta::CPAN
}
else {
$pem_encoded_public_key_string =
_check_for_der_encoded_x509_certificate( $handle, $file_header,
$path )
|| _check_for_der_encoded_private_key( $handle, $file_header, $path )
|| _check_for_der_pkcs10_certificate_request( $handle, $file_header,
$path )
|| _check_for_der_encoded_public_key( $handle, $file_header, $path );
if ( !defined $pem_encoded_public_key_string ) {
Carp::croak("$path is not an X.509 Certificate");
lib/HTTP/PublicKeyPins.pm view on Meta::CPAN
return;
};
return $pem_encoded_public_key_string;
}
sub _check_for_der_encoded_private_key {
my ( $handle, $file_header, $path ) = @_;
my $pem_encoded_public_key_string;
seek $handle, 0, Fcntl::SEEK_SET()
or Carp::croak("Failed to seek to start of $path:$EXTENDED_OS_ERROR");
defined read $handle, my $der_encoded_private_key_string,
_MAX_PUBLIC_KEY_SIZE()
or Carp::croak("Failed to read from $path:$EXTENDED_OS_ERROR");
my $pem_encoded_private_key_string =
"-----BEGIN RSA PRIVATE KEY-----\n"
. MIME::Base64::encode_base64($der_encoded_private_key_string)
. "-----END RSA PRIVATE KEY-----\n";
eval {
my $privkey =
Crypt::OpenSSL::RSA->new_private_key($pem_encoded_private_key_string);
$pem_encoded_public_key_string = $privkey->get_public_key_x509_string();
} or do {
return;
};
return $pem_encoded_public_key_string;
}
sub _process_pem_private_key {
my ( $handle, $file_header, $path ) = @_;
my $pem_encoded_public_key_string;
seek $handle, 0, Fcntl::SEEK_SET()
or Carp::croak("Failed to seek to start of $path:$EXTENDED_OS_ERROR");
defined read $handle, my $rsa_private_key_string, _MAX_PUBLIC_KEY_SIZE()
or Carp::croak("Failed to read from $path:$EXTENDED_OS_ERROR");
my $privkey = Crypt::OpenSSL::RSA->new_private_key($rsa_private_key_string);
$pem_encoded_public_key_string = $privkey->get_public_key_x509_string();
return $pem_encoded_public_key_string;
}
sub _process_pem_public_key {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTPS/Handy.pm view on Meta::CPAN
cn => $cn,
hosts => [ @hosts ],
days => $CERT_DAYS,
);
_write_file($key_file, HTTPS::Handy::X509::private_key_to_pem_any($key));
_write_file($cert_file, HTTPS::Handy::X509::pem_wrap('CERTIFICATE', $der));
chmod 0600, $key_file;
_log_message("Self-signed certificate created at $cert_file") if $log;
return ($cert_file, $key_file);
lib/HTTPS/Handy.pm view on Meta::CPAN
my $key;
my @ec = HTTPS::Handy::X509::pem_blocks($key_pem, 'EC PRIVATE KEY');
my @rsa = HTTPS::Handy::X509::pem_blocks($key_pem, 'RSA PRIVATE KEY');
my @p8 = HTTPS::Handy::X509::pem_blocks($key_pem, 'PRIVATE KEY');
if (@ec) {
$key = HTTPS::Handy::X509::ec_private_key_from_der($ec[0]);
}
elsif (@rsa) {
$key = HTTPS::Handy::X509::private_key_from_der($rsa[0]);
}
elsif (@p8) {
$key = HTTPS::Handy::X509::ec_private_key_from_der($p8[0]);
$key = HTTPS::Handy::X509::private_key_from_der($p8[0]) unless $key;
}
else {
croak "HTTPS::Handy: No PRIVATE KEY block found in $key_file";
}
$key
lib/HTTPS/Handy.pm view on Meta::CPAN
# ----------------------------------------------------------------
# RSA private keys in PKCS #1 and PKCS #8 form
# ----------------------------------------------------------------
sub private_key_to_der {
my ($key) = @_;
return der_sequence(
der_integer("\x00"), # version 0
der_integer_big($key->{'n'}),
der_integer_big($key->{'e'}),
lib/HTTPS/Handy.pm view on Meta::CPAN
der_integer_big($key->{'dq'}),
der_integer_big($key->{'qinv'}),
);
}
sub private_key_to_pem {
my ($key) = @_;
return pem_wrap('RSA PRIVATE KEY', private_key_to_der($key));
}
# private_key_from_der - Read a PKCS #1 (or PKCS #8 wrapped) RSA key
sub private_key_from_der {
my ($der) = @_;
my ($tag, $body) = der_next($der, 0);
return undef unless defined $tag && $tag == 0x30;
my @field = ();
lib/HTTPS/Handy.pm view on Meta::CPAN
}
return undef unless scalar(@field) >= 3;
# PKCS #8: version, AlgorithmIdentifier, OCTET STRING with the key
if (($field[1][0] == 0x30) && ($field[2][0] == 0x04)) {
return private_key_from_der($field[2][1]);
}
return undef unless scalar(@field) >= 9;
my @v = map { HTTPS::Handy::BigInt::b_from_bin($_->[1]) } @field[1 .. 8];
return {
lib/HTTPS/Handy.pm view on Meta::CPAN
my $OID_PRIME256V1 = '1.2.840.10045.3.1.7';
my $OID_ECDSA_SHA256 = '1.2.840.10045.4.3.2';
my $OID_RSA_ENC = '1.2.840.113549.1.1.1';
my $OID_RSA_SHA256 = '1.2.840.113549.1.1.11';
sub ec_private_key_to_der {
my ($key) = @_;
my $point = HTTPS::Handy::EC::point_to_bin($key->{'x'}, $key->{'y'});
return der_sequence(
der_integer("\x01"), # version 1
der_octetstring(HTTPS::Handy::BigInt::b_to_bin($key->{'d'}, 32)),
der_context(0, der_oid($OID_PRIME256V1)),
der_context(1, der_bitstring($point)),
);
}
sub ec_private_key_to_pem {
my ($key) = @_;
return pem_wrap('EC PRIVATE KEY', ec_private_key_to_der($key));
}
# ec_private_key_from_der - Read a SEC 1 (or PKCS #8 wrapped) EC key
sub ec_private_key_from_der {
my ($der) = @_;
my ($tag, $body) = der_next($der, 0);
return undef unless defined $tag && ($tag == 0x30);
my @field = ();
lib/HTTPS/Handy.pm view on Meta::CPAN
return undef unless scalar(@field) >= 2;
# PKCS #8: version, AlgorithmIdentifier, OCTET STRING with the key
if (($field[1][0] == 0x30) && (scalar(@field) >= 3)
&& ($field[2][0] == 0x04)) {
return ec_private_key_from_der($field[2][1]);
}
return undef unless $field[1][0] == 0x04;
my $d = HTTPS::Handy::BigInt::b_from_bin($field[1][1]);
my ($x, $y) = HTTPS::Handy::EC::mul_generator($d);
lib/HTTPS/Handy.pm view on Meta::CPAN
my ($key, $data) = @_;
return HTTPS::Handy::EC::sign($key, $data) if $key->{'type'} eq 'ec';
return HTTPS::Handy::RSA::sign_pkcs1_sha256($key, $data);
}
# private_key_to_pem_any - PEM for either kind of key
sub private_key_to_pem_any {
my ($key) = @_;
return ec_private_key_to_pem($key) if $key->{'type'} eq 'ec';
return private_key_to_pem($key);
}
# ----------------------------------------------------------------
# Building a self-signed certificate
# ----------------------------------------------------------------
view all matches for this distribution
view release on metacpan or search on metacpan
include/hyperman/hm_tls.h view on Meta::CPAN
ERR_print_errors_fp(stderr); SSL_CTX_free(ctx); return NULL;
}
/*
# uncoverable branch true
# uncoverable condition left count:1 class:ignore_covered_err */
if (!SSL_CTX_check_private_key(ctx)) {
hm_errlog("Hyperman TLS: certificate and key do not match\n"); /* # uncoverable statement */
SSL_CTX_free(ctx); return NULL; /* # uncoverable statement */
}
#ifdef HM_HAVE_ALPN
/* h3 only on a QUIC context: offering h2 or http/1.1 over QUIC is a
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Hypersonic/TLS.pm view on Meta::CPAN
->line(' g_ssl_ctx = NULL;')
->line(' return -3;')
->line(' }')
->line('')
->line(' /* Verify private key matches certificate */')
->line(' if (!SSL_CTX_check_private_key(g_ssl_ctx)) {')
->line(' SSL_CTX_free(g_ssl_ctx);')
->line(' g_ssl_ctx = NULL;')
->line(' return -4;')
->line(' }')
->line('')
lib/Hypersonic/TLS.pm view on Meta::CPAN
g_ssl_ctx = NULL;
return -3;
}
/* Verify private key matches certificate */
if (!SSL_CTX_check_private_key(g_ssl_ctx)) {
SSL_CTX_free(g_ssl_ctx);
g_ssl_ctx = NULL;
return -4;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IBM/SONAS.pm view on Meta::CPAN
# Create an IBM::SONAS object
my $ibm = IBM::SONAS->new(
user => 'admin',
host => 'my-sonas.company.com',
key_path => '/path/to/my/.ssh/private_key'
) or die "Couldn't create object! $!\n";
=head1 METHODS
=head3 new ( %ARGS )
my $ibm = IBM::SONAS->new(
user => 'admin',
host => 'my-sonas.company.com',
key_path => '/path/to/my/.ssh/private_key'
) or die "Couldn't create object! $!\n";
Constructor - creates a new IBM::SONAS object. This method accepts three
mandatory parameters and one optional parameter, the three mandatory
parameters are:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IBM/StorageSystem.pm view on Meta::CPAN
# Create a IBM::StorageSystem object
my $ibm = IBM::StorageSystem->new(
user => 'admin',
host => 'my-StorageSystem',
key_path => '/path/to/my/.ssh/private_key'
) or die "Couldn't create object! $!\n";
# Get a list of our enclosures as IBM::StorageSystem::Enclosure objects
my @enclosures = $ibm->get_enclosures;
lib/IBM/StorageSystem.pm view on Meta::CPAN
=head3 new
my $ibm = IBM::StorageSystem->new(
user => 'admin',
host => 'my-StorageSystem',
key_path => '/path/to/my/.ssh/private_key'
) or die "Couldn't create object! $!\n";
Constructor - creates a new IBM::StorageSystem object. This method accepts three mandatory parameters
and one optional parameter, the three mandatory parameters are:
lib/IBM/StorageSystem.pm view on Meta::CPAN
use Date::Calc qw(date_to_Time Today_and_Now);
my $ibm = IBM::StorageSystem->new(
user => 'admin',
host => 'my-v7000',
key_path => '/path/to/my/.ssh/private_key'
) or die "Couldn't create object! $!\n";
# Generate an alert for any replication errors in the last six hours
foreach my $task ( $ibm->get_replications ) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IBM/V7000.pm view on Meta::CPAN
=head3 new
my $ibm = IBM::V7000->new( user => 'admin',
host => 'my-v7000.company.com',
key_path => '/path/to/my/.ssh/private_key'
) or die "Couldn't create object! $!\n";
Constructor - creates a new IBM::V7000 object. This method accepts three mandatory parameters
and one optional parameter, the three mandatory parameters are:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IBM/V7000Unified.pm view on Meta::CPAN
=head3 new
my $ibm = IBM::V7000Unified->new(
user => 'admin',
host => 'my-v7000-unified.company.com',
key_path => '/path/to/my/.ssh/private_key'
) or die "Couldn't create object! $!\n";
Constructor - creates a new IBM::V7000Unified object. This method accepts
three mandatory parameters and one optional parameter, the three mandatory
parameters are:
view all matches for this distribution
view release on metacpan or search on metacpan
ex/crypto.pl view on Meta::CPAN
#note that this code will not work exactly as written, because it needs
#to run on two different boxes.
my ($sender_public_key, $sender_private_key) = IPC::Transit::gen_key_pair();
my ($receiver_public_key, $receiver_private_key) = IPC::Transit::gen_key_pair();
$IPC::Transit::my_hostname = 'sender.hostname.com';
$IPC::Transit::my_keys->{public} = $sender_public_key;
$IPC::Transit::my_keys->{private} = $sender_private_key;
$IPC::Transit::public_keys->{'receiver.hostname.com'} = $receiver_public_key;
IPC::Transit::send(
message => {foo => 'bar'},
ex/crypto.pl view on Meta::CPAN
#teleport over to the receiver, magically using keys generated above
$IPC::Transit::my_hostname = 'receiver.hostname.com';
$IPC::Transit::my_keys->{public} = $receiver_public_key;
$IPC::Transit::my_keys->{private} = $receiver_private_key;
$IPC::Transit::public_keys->{'sender.hostname.com'} = $sender_public_key;
my $message = IPC::Transit::receiver(
qname => 'some_qname'
);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JIRA/REST/OAuth.pm view on Meta::CPAN
else {
%args = @_;
}
# remove arguments for this subclass
my @opts = qw( rsa_private_key oauth_token oauth_token_secret consumer_key );
my %a;
foreach my $opt (@opts) {
croak __PACKAGE__.'::new requires argument '.$opt unless defined $args{$opt};
$a{$opt} = delete $args{$opt};
}
lib/JIRA/REST/OAuth.pm view on Meta::CPAN
my $url = $args{url} if exists $args{url};
my $self = $class->SUPER::new(\%args);
$$self{url} = $url;
# handle our options
if (-e $a{rsa_private_key}) {
open(my $fh, '<', $a{rsa_private_key}) or die "Unable to read $a{rsa_private_key}! $!";
local $/ = undef;
my $data = <$fh>;
close($fh);
$a{rsa_private_key} = Crypt::OpenSSL::RSA->new_private_key($data);
}
else {
$a{rsa_private_key} = Crypt::OpenSSL::RSA->new_private_key($a{rsa_private_key});
}
foreach my $opt (@opts) {
$$self{$opt} = delete $a{$opt};
}
lib/JIRA/REST/OAuth.pm view on Meta::CPAN
consumer_key => $$self{consumer_key},
consumer_secret => 'ignore',
signature_method => 'RSA-SHA1',
protocol_version => Net::OAuth::PROTOCOL_VERSION_1_0,
signature_key => $$self{rsa_private_key},
token => $$self{oauth_token},
token_secret => $$self{oauth_token_secret},
timestamp => time,
nonce => int(rand(2**32)),
lib/JIRA/REST/OAuth.pm view on Meta::CPAN
use JIRA::REST::OAuth;
my $jira = JIRA::REST::OAuth->new(
{
url => 'https://jira.example.net',
rsa_private_key => '/path/to/private/key.pem',
oauth_token => '<oauth_token>',
oauth_token_secret => '<oauth_token_secrete>',
consumer_key => '<key>',
}
);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JSON/WebEncryption.pm view on Meta::CPAN
my $self = bless {}, $caller;
$self->{alg} = $arg{alg};
$self->{enc} = $arg{enc};
$self->{key} = $arg{key};
$self->{private_key} = $arg{private_key};
$self->{public_key} = $arg{public_key};
return $self;
}
lib/JSON/WebEncryption.pm view on Meta::CPAN
# -----------------------------------------------------------------------------
sub _alg_RSA1_5_decode
{
my ( $self, $enc_params, $private_key, $iv, $ciphertext, $encrypted_key ) = @_;
$private_key //= $self->{private_key};
my $cipherType = $enc_params->[0];
my $keysize = $enc_params->[1] / 8; # /8 to get it in bytes
my $padding = $crypt_padding_map{ $enc_params->[3] };
# Decrypt the encryption key using the Private Key
my $rsa = Crypt::OpenSSL::RSA->new_private_key( $private_key ); # Key passed in is a Private Key
$rsa->use_pkcs1_oaep_padding;
my $CEK = $rsa->decrypt( $encrypted_key );
# Use the encryption key to decrypt the message
my $cipher = _getCipher( $cipherType, $CEK, $padding, $iv, $keysize );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JSON/WebToken/Crypt/RSA.pm view on Meta::CPAN
};
sub sign {
my ($class, $algorithm, $message, $key) = @_;
my $private_key = Crypt::OpenSSL::RSA->new_private_key($key);
my $method = $ALGORITHM2SIGNING_METHOD_MAP->{$algorithm};
$private_key->$method;
return $private_key->sign($message);
}
sub verify {
my ($class, $algorithm, $message, $key, $signature) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/TestApp/Plugin/OAuth/Test.pm view on Meta::CPAN
my $signature;
if ($sig_method eq 'RSA-SHA1') {
require Crypt::OpenSSL::RSA;
my $pubkey = Crypt::OpenSSL::RSA->new_private_key($key);
$signature = encode_base64($pubkey->sign($signature_base_string), "");
}
elsif ($sig_method eq 'HMAC-SHA1') {
my $key = join '&',
map { Jifty->web->escape_uri($_||'') }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/LaTeXML/Plugin/LtxMojo/public/js/external/ace-min/mode-php.js view on Meta::CPAN
define("ace/mode/php",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/php_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cs...
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Langertha/Holmgang/Sim/Linux.pm view on Meta::CPAN
sub _wg_conf {
my ($w) = @_;
my @l = ( '[Interface]' );
push @l, "Address = $w->{address}" if defined $w->{address};
push @l, "ListenPort = $w->{listen_port}" if defined $w->{listen_port};
push @l, 'PrivateKey = ' . ( $w->{private_key} // '(nicht angezeigt)' );
push @l, "MTU = $w->{mtu}" if defined $w->{mtu};
for my $k ( sort keys %{ $w->{peers} || {} } ) {
my $p = $w->{peers}{$k};
push @l, '', '[Peer]';
push @l, "# $p->{name}" if defined $p->{name};
view all matches for this distribution