GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  CRYPT::OPENPGP::SESSIONKEY (3)

.ds Aq ’

NAME

Crypt::OpenPGP::SessionKey - Encrypted Session Key

CONTENTS

SYNOPSIS



    use Crypt::OpenPGP::SessionKey;

    my $public_key = Crypt::OpenPGP::Key::Public->new( RSA );
    my $key_data = f x 64;    ## Not a very good key :)

    my $skey = Crypt::OpenPGP::SessionKey->new(
        Key     => $public_key,
        SymKey  => $key_data,
    );
    my $serialized = $skey->save;

    my $secret_key = Crypt::OpenPGP::Key::Secret->new( RSA );
    ( $key_data, my( $alg ) ) = $skey->decrypt( $secret_key );



DESCRIPTION

Crypt::OpenPGP::SessionKey implements encrypted session key packets; these packets store public-key-encrypted key data that, when decrypted using the corresponding secret key, can be used to decrypt a block of ciphertext—that is, a Crypt::OpenPGP::Ciphertext object.

USAGE

Crypt::OpenPGP::SessionKey->new( CW%arg )

Creates a new encrypted session key packet object and returns that object. If there are no arguments in %arg, the object is created empty; this is used, for example in parse (below), to create an empty packet which is then filled from the data in the buffer.

If you wish to initialize a non-empty object, %arg can contain:
o Key

A public key object; in other words, an object of a subclass of Crypt::OpenPGP::Key::Private. The public key is used to encrypt the encoded session key such that it can only be decrypted by the secret portion of the key.

This argument is required (for a non-empty object).

o SymKey

The symmetric cipher key: a string of octets that make up the key data of the symmetric cipher key. This should be at least long enough for the key length of your chosen cipher (see Cipher, below), or, if you have not specified a cipher, at least 64 bytes (to allow for long cipher key sizes).

This argument is required (for a non-empty object).

o Cipher

The name (or ID) of a supported PGP cipher. See Crypt::OpenPGP::Cipher for a list of valid cipher names.

This argument is optional; by default Crypt::OpenPGP::Cipher will use DES3.

CW$skey->save

Serializes the session key packet and returns the string of octets.

    Crypt::OpenPGP::SessionKey->parse($buffer)

Given $buffer, a Crypt::OpenPGP::Buffer object holding (or with offset pointing to) an encrypted session key packet, returns a new Crypt::OpenPGP::Ciphertext object, initialized with the data in the buffer.

CW$skey->decrypt($secret_key)

Given a secret key object $secret_key (an object of a subclass of Crypt::OpenPGP::Key::Public), decrypts and decodes the encrypted session key data. The key data includes the symmetric key itself, along with a one-octet ID of the symmetric cipher used to encrypt the message.

Returns a list containing two items: the symmetric key and the cipher algorithm ID. These are suitable for passing off to the decrypt method of a Crypt::OpenPGP::Ciphertext object to decrypt a block of encrypted data.

CW$skey->key_id

Returns the key ID of the public key used to encrypt the session key; this is necessary for finding the appropriate secret key to decrypt the key.

AUTHOR & COPYRIGHTS

Please see the Crypt::OpenPGP manpage for author, copyright, and license information.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 CRYPT::OPENPGP::SESSIONKEY (3) 2010-12-06

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.