{
    "mode": "perldoc",
    "parameter": "Crypt::DSA::KeyChain",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3ADSA%3A%3AKeyChain/json",
    "generated": "2026-06-15T14:30:14Z",
    "synopsis": "use Crypt::DSA::KeyChain;\nmy $keychain = Crypt::DSA::KeyChain->new;\nmy $key = $keychain->generateparams(\nSize      => 512,\nSeed      => $seed,\nVerbosity => 1,\n);\n$keychain->generatekeys($key);",
    "sections": {
        "NAME": {
            "content": "Crypt::DSA::KeyChain - DSA key generation system\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Crypt::DSA::KeyChain;\nmy $keychain = Crypt::DSA::KeyChain->new;\n\nmy $key = $keychain->generateparams(\nSize      => 512,\nSeed      => $seed,\nVerbosity => 1,\n);\n\n$keychain->generatekeys($key);\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "*Crypt::DSA::KeyChain* is a lower-level interface to key generation than the interface in\n*Crypt::DSA* (the *keygen* method). It allows you to separately generate the *p*, *q*, and *g*\nkey parameters, given an optional starting seed, and a mandatory bit size for *p* (*q* and *g*\nare 160 bits each).\n\nYou can then call *generatekeys* to generate the public and private portions of the key.\n",
            "subsections": []
        },
        "USAGE": {
            "content": "$keychain = Crypt::DSA::KeyChain->new\nConstructs a new *Crypt::DSA::KeyChain* object. At the moment this isn't particularly useful in\nitself, other than being the object you need in order to call the other methods.\n\nReturns the new object.\n\n$key = $keychain->generateparams(%arg)\nGenerates a set of DSA parameters: the *p*, *q*, and *g* values of the key. This involves\nfinding primes, and as such it can be a relatively long process.\n\nWhen invoked in scalar context, returns a new *Crypt::DSA::Key* object.\n\nIn list context, returns the new *Crypt::DSA::Key* object, along with: the value of the internal\ncounter when a suitable prime *p* was found; the value of *h* when *g* was derived; and the\nvalue of the seed (a 20-byte string) when *q* was found. These values aren't particularly useful\nin normal circumstances, but they could be useful.\n\n*%arg* can contain:\n\n*   Size\n\nThe size in bits of the *p* value to generate. The *q* and *g* values are always 160 bits\neach.\n\nThis argument is mandatory.\n\n*   Seed\n\nA seed with which *q* generation will begin. If this seed does not lead to a suitable prime,\nit will be discarded, and a new random seed chosen in its place, until a suitable prime can\nbe found.\n\nThis is entirely optional, and if not provided a random seed will be generated\nautomatically.\n\n*   Verbosity\n\nShould be either 0 or 1. A value of 1 will give you a progress meter during *p* and *q*\ngeneration--this can be useful, since the process can be relatively long.\n\nThe default is 0.\n\n$keychain->generatekeys($key)\nGenerates the public and private portions of the key *$key*, a *Crypt::DSA::Key* object.\n\nAUTHOR & COPYRIGHT\nPlease see the Crypt::DSA manpage for author, copyright, and license information.\n",
            "subsections": []
        }
    },
    "summary": "Crypt::DSA::KeyChain - DSA key generation system",
    "flags": [],
    "examples": [],
    "see_also": []
}