Crypt::RSA::Key::Private -- RSA Private Key Management.
$key = new Crypt::RSA::Key::Private ( Identity => 'Lord Banquo <banquo@lochaber.com>', Password => 'The earth hath bubbles', ); $key->hide(); $key->write( Filename => 'rsakeys/banquo.private' ); $akey = new Crypt::RSA::Key::Private ( Filename => 'rsakeys/banquo.private' ); $akey->reveal ( Password => 'The earth hath bubbles' );
Crypt::RSA::Key::Private provides basic private key management functionality for Crypt::RSA private keys. Following methods are available:
The constructor. Takes a hash, usually with two arguments: Filename and Password. Filename indicates a file from which the private key should be read. More often than not, private keys are kept encrypted with a symmetric cipher and MUST be decrypted before use. When a Password argument is provided, the key is also decrypted before it is returned by new(). Here's a complete list of arguments accepted by new() (all of which are optional):
Filename
Password
new()
A string identifying the owner of the key. Canonically, a name and email address.
Name of the file that contains the private key.
Password with which the private key is encrypted, or should be encrypted (in case of a new key).
Name of the symmetric cipher in which the private key is encrypted (or should be encrypted). The default is "Blowfish" and possible values include DES, IDEA, Twofish and other ciphers supported by Crypt::CBC.
If the key is not decrypted at new(), it can be decrypted by calling reveal() with a Password argument.
reveal()
hide() causes the key to be encrypted by the chosen symmetric cipher and password.
hide()
Causes the key to be written to a disk file specified by the Filename argument. write() will call hide() before writing the key to disk. If you wish to store the key in plain, don't specify a password at new().
write()
Vipul Ved Prakash, <mail@vipul.net>
Crypt::RSA::Key(3), Crypt::RSA::Public(3)
To install Crypt::RSA, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Crypt::RSA
CPAN shell
perl -MCPAN -e shell install Crypt::RSA
For more information on module installation, please visit the detailed CPAN module installation guide.