Crypt-Perl

 view release on metacpan or  search on metacpan

lib/Crypt/Perl/PKCS10.pm  view on Meta::CPAN

=encoding utf-8

=head1 NAME

Crypt::Perl::PKCS10 - Certificate Signing Request (CSR) creation

=head1 SYNOPSIS

    my $pkcs10 = Crypt::Perl::PKCS10->new(

        key => $private_key_obj,

        subject => [
            commonName => 'foo.com',
            localityName => 'somewhere',
            #...
        ],
        attributes => [
            [ 'extensionRequest',
                [ 'subjectAltName',
                    [ dNSName => 'foo.com' ],

lib/Crypt/Perl/X509v3.pm  view on Meta::CPAN

        ],

        serial_number => 12345,

        issuer_unique_id => '..',
        subject_unique_id => '..',
    );

    # The signature algorithm (2nd argument) is not needed
    # when the signing key is Ed25519.
    $cert->sign( $crypt_perl_private_key_obj, 'sha256' );

    my $pem = $cert->to_pem();

=head1 STATUS

This module is B<experimental>! The API may change between versions.
If you’re going to build something off of it, ensure that you check
Crypt::Perl’s changelog before updating this module.

=head1 DESCRIPTION

t/Crypt-Perl-RSA-PrivateKey.t  view on Meta::CPAN


        is(
            $key->can("verify_$alg")->( $key, $message, $key->can("sign_$alg")->( $key, "00$message" ) ),
            q<>,
            "$alg: Perl non-verified a wrong signature",
        );

        SKIP: {
            skip 'No Crypt::OpenSSL::RSA; skipping', 1 if !$self->{'_has_ossl'};

            my $rsa = Crypt::OpenSSL::RSA->new_private_key($largest_pem);
            $alg =~ m<([0-9]+)> or die "huh? $alg";
            $rsa->can("use_sha$1_hash")->($rsa);
            ok(
                $rsa->verify( $message, $signature ),
                "$alg: OpenSSL verified Perl’s signature",
            );
        }
    }

    return;

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.565 second using v1.00-cache-2.02-grep-82fe00e-cpan-2cc899e4a130 )