{
    "content": [
        {
            "type": "text",
            "text": "# Net::DNS::RR::SIG (perldoc)\n\n## NAME\n\nNet::DNS::RR::SIG - DNS SIG resource record\n\n## SYNOPSIS\n\nuse Net::DNS;\n$rr = Net::DNS::RR->new('name SIG typecovered algorithm labels\norgttl sigexpiration siginception\nkeytag signame signature');\nuse Net::DNS::SEC;\n$sigrr = Net::DNS::RR::SIG->create( $string, $keypath,\nsigval => 10    # minutes\n);\n$sigrr->verify( $string, $keyrr ) || die $sigrr->vrfyerrstr;\n$sigrr->verify( $packet, $keyrr ) || die $sigrr->vrfyerrstr;\n\n## DESCRIPTION\n\nClass for DNS digital signature (SIG) resource records.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **METHODS** (2 subsections)\n- **REMARKS**\n- **ACKNOWLEDGMENTS**\n- **COPYRIGHT**\n- **LICENSE**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Net::DNS::RR::SIG",
        "section": "",
        "mode": "perldoc",
        "summary": "Net::DNS::RR::SIG - DNS SIG resource record",
        "synopsis": "use Net::DNS;\n$rr = Net::DNS::RR->new('name SIG typecovered algorithm labels\norgttl sigexpiration siginception\nkeytag signame signature');\nuse Net::DNS::SEC;\n$sigrr = Net::DNS::RR::SIG->create( $string, $keypath,\nsigval => 10    # minutes\n);\n$sigrr->verify( $string, $keyrr ) || die $sigrr->vrfyerrstr;\n$sigrr->verify( $packet, $keyrr ) || die $sigrr->vrfyerrstr;",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 13,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 11,
                "subsections": [
                    {
                        "name": "algorithm",
                        "lines": 65
                    },
                    {
                        "name": "create",
                        "lines": 47
                    }
                ]
            },
            {
                "name": "REMARKS",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "ACKNOWLEDGMENTS",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Net::DNS::RR::SIG - DNS SIG resource record\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Net::DNS;\n$rr = Net::DNS::RR->new('name SIG typecovered algorithm labels\norgttl sigexpiration siginception\nkeytag signame signature');\n\nuse Net::DNS::SEC;\n$sigrr = Net::DNS::RR::SIG->create( $string, $keypath,\nsigval => 10    # minutes\n);\n\n$sigrr->verify( $string, $keyrr ) || die $sigrr->vrfyerrstr;\n$sigrr->verify( $packet, $keyrr ) || die $sigrr->vrfyerrstr;\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Class for DNS digital signature (SIG) resource records.\n\nIn addition to the regular methods inherited from Net::DNS::RR the class contains a method to\nsign packets and scalar data strings using private keys (create) and a method for verifying\nsignatures.\n\nThe SIG RR is an implementation of RFC2931. See Net::DNS::RR::RRSIG for an implementation of\nRFC4034.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "The available methods are those inherited from the base class augmented by the type-specific\nmethods defined in this package.\n\nUse of undocumented package features or direct access to internal data structures is discouraged\nand could result in program termination or other unpredictable behaviour.\n\nalgorithm\n$algorithm = $rr->algorithm;\n\nThe algorithm number field identifies the cryptographic algorithm used to create the signature.\n",
                "subsections": [
                    {
                        "name": "algorithm",
                        "content": "numeric code translation.\n\nsigexpiration and siginception times\nsigex sigin sigval\n$expiration = $rr->sigexpiration;\n$expiration = $rr->sigexpiration( $value );\n\n$inception = $rr->siginception;\n$inception = $rr->siginception( $value );\n\nThe signature expiration and inception fields specify a validity time interval for the\nsignature.\n\nThe value may be specified by a string with format 'yyyymmddhhmmss' or a Perl time() value.\n\nReturn values are dual-valued, providing either a string value or numerical Perl time() value.\n\nkeytag\n$keytag = $rr->keytag;\n$rr->keytag( $keytag );\n\nThe keytag field contains the key tag value of the KEY RR that validates this signature.\n\nsigname\n$signame = $rr->signame;\n$rr->signame( $signame );\n\nThe signer name field value identifies the owner name of the KEY RR that a validator is supposed\nto use to validate this signature.\n\nsignature\nsig\n$sig = $rr->sig;\n$rr->sig( $sig );\n\nThe Signature field contains the cryptographic signature that covers the SIG RDATA (excluding\nthe Signature field) and the subject data.\n\nsigbin\n$sigbin = $rr->sigbin;\n$rr->sigbin( $sigbin );\n\nBinary representation of the cryptographic signature.\n\ncreate\nCreate a signature over scalar data.\n\nuse Net::DNS::SEC;\n\n$keypath = '/home/olaf/keys/Kbla.foo.+001+60114.private';\n\n$sigrr = Net::DNS::RR::SIG->create( $data, $keypath );\n\n$sigrr = Net::DNS::RR::SIG->create( $data, $keypath,\nsigval => 10\n);\n$sigrr->print;\n\n\n# Alternatively use Net::DNS::SEC::Private\n\n$private = Net::DNS::SEC::Private->new($keypath);\n\n$sigrr= Net::DNS::RR::SIG->create( $data, $private );\n"
                    },
                    {
                        "name": "create",
                        "content": "This method returns a SIG with the signature over the data made with the private key stored in\nthe key file.\n\nThe first argument is a scalar that contains the data to be signed.\n\nThe second argument is a string which specifies the path to a file containing the private key as\ngenerated using dnssec-keygen, a program that comes with the ISC BIND distribution.\n\nThe optional remaining arguments consist of ( name => value ) pairs as follows:\n\nsigin  => 20211201010101,       # signature inception\nsigex  => 20211201011101,       # signature expiration\nsigval => 10,                   # validity window (minutes)\n\nThe sigin and sigex values may be specified as Perl time values or as a string with the format\n'yyyymmddhhmmss'. The default for sigin is the time of signing.\n\nThe sigval argument specifies the signature validity window in minutes ( sigex = sigin + sigval\n).\n\nBy default the signature is valid for 10 minutes.\n\n*   Do not change the name of the private key file. The create method uses the filename as\ngenerated by dnssec-keygen to determine the keyowner, algorithm, and the keyid (keytag).\n\nverify\n$verify = $sigrr->verify( $data, $keyrr );\n$verify = $sigrr->verify( $data, [$keyrr, $keyrr2, $keyrr3] );\n\nThe verify() method performs SIG0 verification of the specified data against the signature\ncontained in the $sigrr object itself using the public key in $keyrr.\n\nIf a reference to a Net::DNS::Packet is supplied, the method performs a SIG0 verification on the\npacket data.\n\nThe second argument can either be a Net::DNS::RR::KEYRR object or a reference to an array of\nsuch objects. Verification will return successful as soon as one of the keys in the array leads\nto positive validation.\n\nReturns false on error and sets $sig->vrfyerrstr\n\nvrfyerrstr\n$sig0 = $packet->sigrr || die 'not signed';\nprint $sig0->vrfyerrstr unless $sig0->verify( $packet, $keyrr );\n\n$sigrr->verify( $packet, $keyrr ) || die $sigrr->vrfyerrstr;\n"
                    }
                ]
            },
            "REMARKS": {
                "content": "The code is not optimised for speed.\n\nIf this code is still around in 2100 (not a leap year) you will need to check for proper\nhandling of times after 28th February.\n",
                "subsections": []
            },
            "ACKNOWLEDGMENTS": {
                "content": "Although their original code may have disappeared following redesign of Net::DNS, Net::DNS::SEC\nand the OpenSSL API, the following individual contributors deserve to be recognised for their\nsignificant influence on the development of the SIG package.\n\nAndy Vaskys (Network Associates Laboratories) supplied code for RSA.\n\nT.J. Mather provided support for the DSA algorithm.\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright (c)2001-2005 RIPE NCC, Olaf M. Kolkman\n\nCopyright (c)2007-2008 NLnet Labs, Olaf M. Kolkman\n\nPortions Copyright (c)2014 Dick Franks\n\nAll rights reserved.\n\nPackage template (c)2009,2012 O.M.Kolkman and R.W.Franks.\n",
                "subsections": []
            },
            "LICENSE": {
                "content": "Permission to use, copy, modify, and distribute this software and its documentation for any\npurpose and without fee is hereby granted, provided that the original copyright notices appear\nin all copies and that both copyright notice and this permission notice appear in supporting\ndocumentation, and that the name of the author not be used in advertising or publicity\npertaining to distribution of the software without specific prior written permission.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING\nBUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "perl, Net::DNS, Net::DNS::RR, Net::DNS::SEC, RFC2536, RFC2931, RFC3110, RFC4034\n\nAlgorithm Numbers <http://www.iana.org/assignments/dns-sec-alg-numbers>\n\nBIND Administrator Reference Manual <http://bind.isc.org/>\n",
                "subsections": []
            }
        }
    }
}