.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Crypt::DSA::KeyChain 3pm" .TH Crypt::DSA::KeyChain 3pm "2022-06-12" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Crypt::DSA::KeyChain \- DSA key generation system .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& 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); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fICrypt::DSA::KeyChain\fR is a lower-level interface to key generation than the interface in \fICrypt::DSA\fR (the \fIkeygen\fR method). It allows you to separately generate the \fIp\fR, \fIq\fR, and \fIg\fR key parameters, given an optional starting seed, and a mandatory bit size for \fIp\fR (\fIq\fR and \fIg\fR are 160 bits each). .PP You can then call \fIgenerate_keys\fR to generate the public and private portions of the key. .SH "USAGE" .IX Header "USAGE" .ie n .SS "$keychain = Crypt::DSA::KeyChain\->new" .el .SS "\f(CW$keychain\fP = Crypt::DSA::KeyChain\->new" .IX Subsection "$keychain = Crypt::DSA::KeyChain->new" Constructs a new \fICrypt::DSA::KeyChain\fR 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. .PP Returns the new object. .ie n .SS "$key = $keychain\->generate_params(%arg)" .el .SS "\f(CW$key\fP = \f(CW$keychain\fP\->generate_params(%arg)" .IX Subsection "$key = $keychain->generate_params(%arg)" Generates a set of \s-1DSA\s0 parameters: the \fIp\fR, \fIq\fR, and \fIg\fR values of the key. This involves finding primes, and as such it can be a relatively long process. .PP When invoked in scalar context, returns a new \&\fICrypt::DSA::Key\fR object. .PP In list context, returns the new \fICrypt::DSA::Key\fR object, along with: the value of the internal counter when a suitable prime \fIp\fR was found; the value of \fIh\fR when \fIg\fR was derived; and the value of the seed (a 20\-byte string) when \fIq\fR was found. These values aren't particularly useful in normal circumstances, but they could be useful. .PP \&\fI\f(CI%arg\fI\fR can contain: .IP "\(bu" 4 Size .Sp The size in bits of the \fIp\fR value to generate. The \fIq\fR and \&\fIg\fR values are always 160 bits each. .Sp This argument is mandatory. .IP "\(bu" 4 Seed .Sp A seed with which \fIq\fR 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. .Sp This is entirely optional, and if not provided a random seed will be generated automatically. .IP "\(bu" 4 Verbosity .Sp Should be either 0 or 1. A value of 1 will give you a progress meter during \fIp\fR and \fIq\fR generation\*(--this can be useful, since the process can be relatively long. .Sp The default is 0. .ie n .SS "$keychain\->generate_keys($key)" .el .SS "\f(CW$keychain\fP\->generate_keys($key)" .IX Subsection "$keychain->generate_keys($key)" Generates the public and private portions of the key \fI\f(CI$key\fI\fR, a \fICrypt::DSA::Key\fR object. .SH "AUTHOR & COPYRIGHT" .IX Header "AUTHOR & COPYRIGHT" Please see the Crypt::DSA manpage for author, copyright, and license information.