Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

crypt::dsa::keychain(3pm) [debian man page]

Crypt::DSA::KeyChain(3pm)				User Contributed Perl Documentation				 Crypt::DSA::KeyChain(3pm)

NAME
Crypt::DSA::KeyChain - DSA key generation system SYNOPSIS
use Crypt::DSA::KeyChain; my $keychain = Crypt::DSA::KeyChain->new; my $key = $keychain->generate_params( Size => 512, Seed => $seed, Verbosity => 1, ); $keychain->generate_keys($key); DESCRIPTION
Crypt::DSA::KeyChain is a lower-level interface to key generation than the interface in Crypt::DSA (the keygen method). It allows you to separately generate the p, q, and g key parameters, given an optional starting seed, and a mandatory bit size for p (q and g are 160 bits each). You can then call generate_keys to generate the public and private portions of the key. USAGE
$keychain = Crypt::DSA::KeyChain->new Constructs a new Crypt::DSA::KeyChain object. At the moment this isn't particularly useful in itself, other than being the object you need in order to call the other methods. Returns the new object. $key = $keychain->generate_params(%arg) Generates a set of DSA parameters: the p, q, and g values of the key. This involves finding primes, and as such it can be a relatively long process. When invoked in scalar context, returns a new Crypt::DSA::Key object. In list context, returns the new Crypt::DSA::Key object, along with: the value of the internal counter when a suitable prime p was found; the value of h when g was derived; and the value of the seed (a 20-byte string) when q was found. These values aren't particularly useful in normal circumstances, but they could be useful. %arg can contain: o Size The size in bits of the p value to generate. The q and g values are always 160 bits each. This argument is mandatory. o Seed A seed with which q generation will begin. If this seed does not lead to a suitable prime, it will be discarded, and a new random seed chosen in its place, until a suitable prime can be found. This is entirely optional, and if not provided a random seed will be generated automatically. o Verbosity Should be either 0 or 1. A value of 1 will give you a progress meter during p and q generation--this can be useful, since the process can be relatively long. The default is 0. $keychain->generate_keys($key) Generates the public and private portions of the key $key, a Crypt::DSA::Key object. AUTHOR &; COPYRIGHT Please see the Crypt::DSA manpage for author, copyright, and license information. perl v5.12.4 2011-10-05 Crypt::DSA::KeyChain(3pm)

Check Out this Related Man Page

Crypt::DSA::Key(3pm)					User Contributed Perl Documentation				      Crypt::DSA::Key(3pm)

NAME
Crypt::DSA::Key - DSA key SYNOPSIS
use Crypt::DSA::Key; my $key = Crypt::DSA::Key->new; $key->p($p); DESCRIPTION
Crypt::DSA::Key contains a DSA key, both the public and private portions. Subclasses of Crypt::DSA::Key implement read and write methods, such that you can store DSA keys on disk, and read them back into your application. USAGE
Any of the key attributes can be accessed through combination get/set methods. The key attributes are: p, q, g, priv_key, and pub_key. For example: $key->p($p); my $p2 = $key->p; $key = Crypt::DSA::Key->new(%arg) Creates a new (empty) key object. All of the attributes are initialized to 0. Alternately, if you provide the Filename parameter (see below), the key will be read in from disk. If you provide the Type parameter (mandatory if Filename is provided), be aware that your key will actually be blessed into a subclass of Crypt::DSA::Key. Specifically, it will be the class implementing the specific read functionality for that type, eg. Crypt::DSA::Key::PEM. Returns the key on success, "undef" otherwise. (See Password for one reason why new might return "undef"). %arg can contain: o Type The type of file where the key is stored. Currently the only option is PEM, which indicates a PEM file (optionally encrypted, ASN.1-encoded object). Support for reading/writing PEM files comes from Convert::PEM; if you don't have this module installed, the new method will die. This argument is mandatory, if you're either reading the file from disk (ie. you provide a Filename argument) or you've specified the Content argument. o Filename The location of the file from which you'd like to read the key. Requires a Type argument so the decoder knows what type of file it is. You can't specify Content and Filename at the same time. o Content The serialized version of the key. Requires a Type argument so the decoder knows how to decode it. You can't specify Content and Filename at the same time. o Password If your key file is encrypted, you'll need to supply a passphrase to decrypt it. You can do that here. If your passphrase is incorrect, new will return "undef". $key->write(%arg) Writes a key (optionally) to disk, using a format that you define with the Type parameter. If your $key object has a defined priv_key (private key portion), the key will be written as a DSA private key object; otherwise, it will be written out as a public key. Note that not all serialization mechanisms can produce public keys in this version--currently, only PEM public keys are supported. %arg can include: o Type The type of file format that you wish to write. PEM is one example (in fact, currently, it's the only example). This argument is mandatory, unless your $key object is already blessed into a subclass (eg. Crypt::DSA::Key::PEM), and you wish to write the file using the same subclass. o Filename The location of the file on disk where you want the key file to be written. o Password If you want the key file to be encrypted, provide this argument, and the ASN.1-encoded string will be encrypted using the passphrase as a key. $key->size Returns the size of the key, in bits. This is actually the number of bits in the large prime p. AUTHOR &; COPYRIGHTS Please see the Crypt::DSA manpage for author, copyright, and license information. perl v5.12.4 2011-06-17 Crypt::DSA::Key(3pm)
Man Page