File: README

package info (click to toggle)
libcrypt-rsa-parse-perl 0.044-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 144 kB
  • sloc: perl: 251; makefile: 2
file content (67 lines) | stat: -rw-r--r-- 2,121 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
=pod

=encoding utf-8

=head1 NAME

Crypt::RSA::Parse - Parse RSA keys

=head1 SYNOPSIS

    #General-purpose, native RSA or PKCS8 (DER or PEM)
    my $public_rsa = Crypt::RSA::Parse::public($key_str);
    my $private_rsa = Crypt::RSA::Parse::private($private_key_str);

    $public_rsa->exponent();    #alias E()
    $public_rsa->modulus();     #isa Math::BigInt, alias N()
    $public_rsa->size();        #i.e., the modulus length in bits

    $private_rsa->version();        #usually 0
    $private_rsa->modulus();        #isa Math::BigInt, alias N()
    $private_rsa->size();           #i.e., the modulus length in bits

    $private_rsa->publicExponent();     #same as public “exponent”, alias E()
    $private_rsa->privateExponent();    #isa Math::BigInt, alias D()
    $private_rsa->prime1();             #isa Math::BigInt, alias P()
    $private_rsa->prime2();             #isa Math::BigInt, alias Q()
    $private_rsa->exponent1();          #isa Math::BigInt, alias DP()
    $private_rsa->exponent2();          #isa Math::BigInt, alias DQ()
    $private_rsa->coefficient();        #isa Math::BigInt, alias QINV()

    #Only checks PKCS8 (DER or PEM)
    $public_rsa = Crypt::RSA::Parse::public_pkcs8($pkcs8_str);
    $private_rsa = Crypt::RSA::Parse::private_pkcs8($pkcs8_str);

    {
        #If, for whatever reason, you don’t like MIME::Base64,
        #then customize this. The module must have a decode() function.
        #
        local $Crypt::RSA::Parse::BASE64_MODULE = '..';

        Crypt::RSA::Parse::...
    }

=head1 DESCRIPTION

Not much else to say: it parses RSA keys for useful information!

The public keys are represented via the C<Crypt::RSA::Parse::Public>
class, while private keys are represented via C<Crypt::RSA::Parse::Private>.

=head1 AUTHOR

    Felipe M. L. Gasper
    CPAN ID: FELIPE

=head1 REPOSITORY

    https://github.com/FGasper/p5-Crypt-RSA-Parse

=head1 COPYRIGHT

This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the
LICENSE file included with this module.