• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

lib/Crypt/RSA/H25-Aug-2018-454251

t/H25-Aug-2018-191146

ChangesH A D25-Aug-2018593 2315

LICENSEH A D25-Aug-201820.1 KiB384309

MANIFESTH A D25-Aug-2018493 1817

META.jsonH A D25-Aug-20181.4 KiB6160

META.ymlH A D25-Aug-2018782 3332

Makefile.PLH A D02-Dec-20161 KiB3329

READMEH A D02-Dec-20162.1 KiB6845

README

1=pod
2
3=encoding utf-8
4
5=head1 NAME
6
7Crypt::RSA::Parse - Parse RSA keys
8
9=head1 SYNOPSIS
10
11    #General-purpose, native RSA or PKCS8 (DER or PEM)
12    my $public_rsa = Crypt::RSA::Parse::public($key_str);
13    my $private_rsa = Crypt::RSA::Parse::private($private_key_str);
14
15    $public_rsa->exponent();    #alias E()
16    $public_rsa->modulus();     #isa Math::BigInt, alias N()
17    $public_rsa->size();        #i.e., the modulus length in bits
18
19    $private_rsa->version();        #usually 0
20    $private_rsa->modulus();        #isa Math::BigInt, alias N()
21    $private_rsa->size();           #i.e., the modulus length in bits
22
23    $private_rsa->publicExponent();     #same as public “exponent”, alias E()
24    $private_rsa->privateExponent();    #isa Math::BigInt, alias D()
25    $private_rsa->prime1();             #isa Math::BigInt, alias P()
26    $private_rsa->prime2();             #isa Math::BigInt, alias Q()
27    $private_rsa->exponent1();          #isa Math::BigInt, alias DP()
28    $private_rsa->exponent2();          #isa Math::BigInt, alias DQ()
29    $private_rsa->coefficient();        #isa Math::BigInt, alias QINV()
30
31    #Only checks PKCS8 (DER or PEM)
32    $public_rsa = Crypt::RSA::Parse::public_pkcs8($pkcs8_str);
33    $private_rsa = Crypt::RSA::Parse::private_pkcs8($pkcs8_str);
34
35    {
36        #If, for whatever reason, you don’t like MIME::Base64,
37        #then customize this. The module must have a decode() function.
38        #
39        local $Crypt::RSA::Parse::BASE64_MODULE = '..';
40
41        Crypt::RSA::Parse::...
42    }
43
44=head1 DESCRIPTION
45
46Not much else to say: it parses RSA keys for useful information!
47
48The public keys are represented via the C<Crypt::RSA::Parse::Public>
49class, while private keys are represented via C<Crypt::RSA::Parse::Private>.
50
51=head1 AUTHOR
52
53    Felipe M. L. Gasper
54    CPAN ID: FELIPE
55
56=head1 REPOSITORY
57
58    https://github.com/FGasper/p5-Crypt-RSA-Parse
59
60=head1 COPYRIGHT
61
62This program is free software; you can redistribute
63it and/or modify it under the same terms as Perl itself.
64
65The full text of the license can be found in the
66LICENSE file included with this module.
67
68