{
    "content": [
        {
            "type": "text",
            "text": "# Crypt::DSA::Key (perldoc)\n\n## NAME\n\nCrypt::DSA::Key - DSA key\n\n## SYNOPSIS\n\nuse Crypt::DSA::Key;\nmy $key = Crypt::DSA::Key->new;\n$key->p($p);\n\n## DESCRIPTION\n\n*Crypt::DSA::Key* contains a DSA key, both the public and private portions. Subclasses of\n*Crypt::DSA::Key* implement *read* and *write* methods, such that you can store DSA keys on\ndisk, and read them back into your application.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **USAGE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Crypt::DSA::Key",
        "section": "",
        "mode": "perldoc",
        "summary": "Crypt::DSA::Key - DSA key",
        "synopsis": "use Crypt::DSA::Key;\nmy $key = Crypt::DSA::Key->new;\n$key->p($p);",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "USAGE",
                "lines": 82,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Crypt::DSA::Key - DSA key\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Crypt::DSA::Key;\nmy $key = Crypt::DSA::Key->new;\n\n$key->p($p);\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "*Crypt::DSA::Key* contains a DSA key, both the public and private portions. Subclasses of\n*Crypt::DSA::Key* implement *read* and *write* methods, such that you can store DSA keys on\ndisk, and read them back into your application.\n",
                "subsections": []
            },
            "USAGE": {
                "content": "Any of the key attributes can be accessed through combination get/set methods. The key\nattributes are: *p*, *q*, *g*, *privkey*, and *pubkey*. For example:\n\n$key->p($p);\nmy $p2 = $key->p;\n\n$key = Crypt::DSA::Key->new(%arg)\nCreates a new (empty) key object. All of the attributes are initialized to 0.\n\nAlternately, if you provide the *Filename* parameter (see below), the key will be read in from\ndisk. If you provide the *Type* parameter (mandatory if *Filename* is provided), be aware that\nyour key will actually be blessed into a subclass of *Crypt::DSA::Key*. Specifically, it will be\nthe class implementing the specific read functionality for that type, eg.\n*Crypt::DSA::Key::PEM*.\n\nReturns the key on success, \"undef\" otherwise. (See *Password* for one reason why *new* might\nreturn \"undef\").\n\n*%arg* can contain:\n\n*   Type\n\nThe type of file where the key is stored. Currently the only option is *PEM*, which\nindicates a PEM file (optionally encrypted, ASN.1-encoded object). Support for\nreading/writing PEM files comes from *Convert::PEM*; if you don't have this module\ninstalled, the *new* method will die.\n\nThis argument is mandatory, *if* you're either reading the file from disk (ie. you provide a\n*Filename* argument) or you've specified the *Content* argument.\n\n*   Filename\n\nThe location of the file from which you'd like to read the key. Requires a *Type* argument\nso the decoder knows what type of file it is. You can't specify *Content* and *Filename* at\nthe same time.\n\n*   Content\n\nThe serialized version of the key. Requires a *Type* argument so the decoder knows how to\ndecode it. You can't specify *Content* and *Filename* at the same time.\n\n*   Password\n\nIf your key file is encrypted, you'll need to supply a passphrase to decrypt it. You can do\nthat here.\n\nIf your passphrase is incorrect, *new* will return \"undef\".\n\n$key->write(%arg)\nWrites a key (optionally) to disk, using a format that you define with the *Type* parameter.\n\nIf your *$key* object has a defined *privkey* (private key portion), the key will be written as\na DSA private key object; otherwise, it will be written out as a public key. Note that not all\nserialization mechanisms can produce public keys in this version--currently, only PEM public\nkeys are supported.\n\n*%arg* can include:\n\n*   Type\n\nThe type of file format that you wish to write. *PEM* is one example (in fact, currently,\nit's the only example).\n\nThis argument is mandatory, *unless* your *$key* object is already blessed into a subclass\n(eg. *Crypt::DSA::Key::PEM*), and you wish to write the file using the same subclass.\n\n*   Filename\n\nThe location of the file on disk where you want the key file to be written.\n\n*   Password\n\nIf you want the key file to be encrypted, provide this argument, and the ASN.1-encoded\nstring will be encrypted using the passphrase as a key.\n\n$key->size\nReturns the size of the key, in bits. This is actually the number of bits in the large prime\n*p*.\n\nAUTHOR & COPYRIGHTS\nPlease see the Crypt::DSA manpage for author, copyright, and license information.\n",
                "subsections": []
            }
        }
    }
}