|
NAMECrypt::OpenPGP::Certificate - PGP Key certificateSYNOPSISuse Crypt::OpenPGP::Certificate; my $dsa_secret_key = Crypt::OpenPGP::Key::Secret->new( 'DSA' ); my $cert = Crypt::OpenPGP::Certificate->new( Key => $dsa_secret_key, Version => 4, Passphrase => 'foobar', ); my $serialized = $cert->save; # Unlock the locked certificate (using the passphrase from above) $cert->unlock( 'foobar' ); DESCRIPTIONCrypt::OpenPGP::Certificate encapsulates a PGP key certificate for any underlying public-key algorithm, for public and secret keys, and for master keys and subkeys. All of these scenarios are handled by the same Certificate class.A Crypt::OpenPGP::Certificate object wraps around a Crypt::OpenPGP::Key object; the latter implements all public-key algorithm-specific functionality, while the certificate layer manages some meta-data about the key, as well as the mechanisms for locking and unlocking a secret key (using a passphrase). USAGECrypt::OpenPGP::Certificate->new( %arg )Constructs a new PGP key certificate object and returns that object. If no arguments are provided in %arg, the certificate is empty; this is used in parse, for example, to construct an empty object, then fill it with the data in the buffer.%arg can contain:
$cert->saveSerializes the Crypt::OpenPGP::Certificate object $cert into a string of octets, suitable for saving in a keyring file.Crypt::OpenPGP::Certificate->parse($buffer)Given $buffer, a Crypt::OpenPGP::Buffer object holding (or with offset point to) a certificate packet, returns a new object of type Crypt::OpenPGP::Certificate, initialized with the data from the buffer.$cert->lock($passphrase)Locks the secret key data by encrypting that data with $passphrase.Returns true on success, "undef" on failure; in the case of failure call errstr to get the error message. $cert->unlock($passphrase)Uses the passphrase $passphrase to unlock (decrypt) the secret part of the key.Returns true on success, "undef" on failure; in the case of failure call errstr to get the error message. $cert->fingerprintReturns the key fingerprint as an octet string.$cert->fingerprint_hexReturns the key fingerprint as a hex string.$cert->fingerprint_wordsReturns the key fingerprint as a list of English words, where each word represents one octet from the fingerprint. See Crypt::OpenPGP::Words for more details about the encoding.$cert->key_idReturns the key ID.$cert->key_id_hexReturns the key ID as a hex string.$cert->keyReturns the algorithm-specific portion of the certificate, the public or secret key object (an object of type Crypt::OpenPGP::Key).$cert->public_certReturns a public version of the certificate, with a public key. If the certificate was already public, the same certificate is returned; if it was a secret certificate, a new Crypt::OpenPGP::Certificate object is created, and the secret key is made into a public version of the key.$cert->versionReturns the version of the certificate (3 or 4).$cert->timestampReturns the creation date and time (in epoch time).$cert->validityReturns the number of days that the certificate is valid for version 3 keys.$cert->is_secretReturns true if the certificate holds a secret key, false otherwise.$cert->is_protectedReturns true if the certificate is locked, false otherwise.$cert->is_subkeyReturns true if the certificate is a subkey, false otherwise.$cert->can_encryptReturns true if the public key algorithm for the certificate $cert can perform encryption/decryption, false otherwise.$cert->can_signReturns true if the public key algorithm for the certificate $cert can perform signing/verification, false otherwise.AUTHOR & COPYRIGHTSPlease see the Crypt::OpenPGP manpage for author, copyright, and license information.
Visit the GSP FreeBSD Man Page Interface. |