A PGP packet object of some kind. Currently the two supported objects are Crypt::OpenPGP::Certificate objects, to create self-signatures for keyrings, and Crypt::OpenPGP::Plaintext objects, for signatures on blocks of data.
This argument is required (for a non-empty packet).
A secret-key certificate that can be used to sign the data. In other words an object of type Crypt::OpenPGP::Certificate that holds a secret key.
This argument is required.
The packet format version of the signature. Valid values are either 3 or 4; version 4 signatures are the default, but will be incompatible with older PGP implementations; for example, PGP2 will only read version 3 signatures; PGP5 can read version 4 signatures, but only on signatures of data packets (not on key signatures).
This argument is optional; the default is version 4.
Specifies the type of signature (data, key, etc.). Valid values can be found in the OpenPGP RFC, section 5.2.1.
This argument is optional; the default is 0x00, signature of a binary document.
The digest algorithm to use when generating the digest of the data to be signed. See the documentation for Crypt::OpenPGP::Digest for a list of valid values.
This argument is optional; the default is SHA1.
Given $buffer, a Crypt::OpenPGP::Buffer object holding (or with offset pointing to) a signature packet, returns a new Crypt::OpenPGP::Signature object, initialized with the signature data in the buffer.
CW$sig->hash_data(@data)Prepares a digital hash of the packets in @data; the hashing method depends on the type of packets in @data, and the hashing algorithm used depends on the algorithm associated with the Crypt::OpenPGP::Signature object $sig. This digital hash is then signed to produce the signature itself.
You generally do not need to use this method unless you have not passed in the Data parameter to new (above).
There are two possible packet types that can be included in @data:
o Key Certificate and User ID
An OpenPGP keyblock contains a key certificate and a signature of the public key and user ID made by the secret key. This is called a self-signature. To produce a self-signature, @data should contain two packet objects: a Crypt::OpenPGP::Certificate object and a Crypt::OpenPGP::UserID object. For example:
my $hash = $sig->hash_data($cert, $id) or die $sig->errstr;
To sign a piece of plaintext, pass in a Crypt::OpenPGP::Plaintext object. This is a standard OpenPGP signature.
my $pt = Crypt::OpenPGP::Plaintext->new( Data => foo bar ); my $hash = $sig->hash_data($pt) or die $sig->errstr;
CW$sig->key_idReturns the ID of the key that created the signature.
CW$sig->timestampReturns the time that the signature was created in Unix epoch time (seconds since 1970).
CW$sig->digestReturns a Crypt::OpenPGP::Digest object representing the digest algorithm used by the signature.
Please see the Crypt::OpenPGP manpage for author, copyright, and license information.
|perl v5.20.3||CRYPT::OPENPGP::SIGNATURE (3)||2009-12-11|