Crypt_GPG
[ class tree: Crypt_GPG ] [ index: Crypt_GPG ] [ all elements ]

Class: Crypt_GPG_SubKey

Source Location: /Crypt_GPG-1.4.0b4/Crypt/GPG/SubKey.php

Class Overview


A class for GPG sub-key information


Author(s):

Copyright:

  • 2005-2010 silverorange

Methods


Inherited Variables

Inherited Methods


Class Details

[line 54]
A class for GPG sub-key information

This class is used to store the results of the Crypt_GPG::getKeys() method. Sub-key objects are members of a Crypt_GPG_Key object.



[ Top ]


Method Detail

__construct (Constructor)   [line 216]

Crypt_GPG_SubKey __construct( [Crypt_GPG_SubKey|string|array $key = null])

Creates a new sub-key object

Sub-keys can be initialized from an array of named values. Available names are:

  • string id - the key id of the sub-key.
  • integer algorithm - the encryption algorithm of the sub-key.
  • string fingerprint - the fingerprint of the sub-key. The fingerprint should not contain formatting characters.
  • integer length - the length of the sub-key in bits.
  • integer creation - the date the sub-key was created. This is a UNIX timestamp.
  • integer expiration - the date the sub-key expires. This is a UNIX timestamp. If the sub-key does not expire, use 0.
  • boolean canSign - whether or not the sub-key can be used to sign data.
  • boolean canEncrypt - whether or not the sub-key can be used to encrypt data.
  • boolean hasPrivate - whether or not the private key for the sub-key exists in the keyring.
  • boolean isRevoked - whether or not this sub-key is revoked.

  • Access: public

Parameters:

Crypt_GPG_SubKey|string|array   $key     optional. Either an existing sub-key object, which is copied; a sub-key string, which is parsed; or an array of initial values.

[ Top ]

canEncrypt   [line 390]

boolean canEncrypt( )

Gets whether or not this sub-key can encrypt data
  • Return: true if this sub-key can encrypt data and false if this sub-key can not encrypt data.
  • Access: public

[ Top ]

canSign   [line 376]

boolean canSign( )

Gets whether or not this sub-key can sign data
  • Return: true if this sub-key can sign data and false if this sub-key can not sign data.
  • Access: public

[ Top ]

getAlgorithm   [line 305]

integer getAlgorithm( )

Gets the algorithm used by this sub-key

The algorithm should be one of the Crypt_GPG_SubKey::ALGORITHM_* constants.

  • Return: the algorithm used by this sub-key.
  • Access: public

[ Top ]

getCreationDate   [line 320]

integer getCreationDate( )

Gets the creation date of this sub-key

This is a Unix timestamp.

  • Return: the creation date of this sub-key.
  • Access: public

[ Top ]

getExpirationDate   [line 336]

integer getExpirationDate( )

Gets the date this sub-key expires

This is a Unix timestamp. If this sub-key does not expire, this will be zero.

  • Return: the date this sub-key expires.
  • Access: public

[ Top ]

getFingerprint   [line 349]

string getFingerprint( )

Gets the fingerprint of this sub-key
  • Return: the fingerprint of this sub-key.
  • Access: public

[ Top ]

getId   [line 289]

string getId( )

Gets the id of this sub-key
  • Return: the id of this sub-key.
  • Access: public

[ Top ]

getLength   [line 362]

integer getLength( )

Gets the length of this sub-key in bits
  • Return: the length of this sub-key in bits.
  • Access: public

[ Top ]

hasPrivate   [line 405]

boolean hasPrivate( )

Gets whether or not the private key for this sub-key exists in the keyring
  • Return: true the private key for this sub-key exists in the keyring and false if it does not.
  • Access: public

[ Top ]

isRevoked   [line 418]

boolean isRevoked( )

Gets whether or not this sub-key is revoked
  • Return: true if this sub-key is revoked and false if it is not.
  • Access: public

[ Top ]

parse   [line 607]

Crypt_GPG_SubKey parse( string $string)

Parses a sub-key object from a sub-key string

See doc/DETAILS in the GPG distribution for information on how the sub-key string is parsed.

  • Return: the sub-key object parsed from the string.
  • Access: public

Parameters:

string   $string     the string containing the sub-key.

[ Top ]

setAlgorithm   [line 486]

Crypt_GPG_SubKey setAlgorithm( integer $algorithm)

Sets the algorithm used by this sub-key
  • Return: the current object, for fluent interface.
  • Access: public

Parameters:

integer   $algorithm     the algorithm used by this sub-key.

[ Top ]

setCanEncrypt   [line 552]

Crypt_GPG_SubKey setCanEncrypt( boolean $canEncrypt)

Sets whether of not this sub-key can encrypt data
  • Return: the current object, for fluent interface.
  • Access: public

Parameters:

boolean   $canEncrypt     true if this sub-key can encrypt data and false if it can not.

[ Top ]

setCanSign   [line 535]

Crypt_GPG_SubKey setCanSign( boolean $canSign)

Sets whether of not this sub-key can sign data
  • Return: the current object, for fluent interface.
  • Access: public

Parameters:

boolean   $canSign     true if this sub-key can sign data and false if it can not.

[ Top ]

setCreationDate   [line 435]

Crypt_GPG_SubKey setCreationDate( integer $creationDate)

Sets the creation date of this sub-key

The creation date is a Unix timestamp.

  • Return: the current object, for fluent interface.
  • Access: public

Parameters:

integer   $creationDate     the creation date of this sub-key.

[ Top ]

setExpirationDate   [line 454]

Crypt_GPG_SubKey setExpirationDate( integer $expirationDate)

Sets the expiration date of this sub-key

The expiration date is a Unix timestamp. Specify zero if this sub-key does not expire.

  • Return: the current object, for fluent interface.
  • Access: public

Parameters:

integer   $expirationDate     the expiration date of this sub-key.

[ Top ]

setFingerprint   [line 502]

Crypt_GPG_SubKey setFingerprint( string $fingerprint)

Sets the fingerprint of this sub-key
  • Return: the current object, for fluent interface.
  • Access: public

Parameters:

string   $fingerprint     the fingerprint of this sub-key.

[ Top ]

setHasPrivate   [line 571]

Crypt_GPG_SubKey setHasPrivate( boolean $hasPrivate)

Sets whether of not the private key for this sub-key exists in the keyring
  • Return: the current object, for fluent interface.
  • Access: public

Parameters:

boolean   $hasPrivate     true if the private key for this sub-key exists in the keyring and false if it does not.

[ Top ]

setId   [line 470]

Crypt_GPG_SubKey setId( string $id)

Sets the id of this sub-key
  • Return: the current object, for fluent interface.
  • Access: public

Parameters:

string   $id     the id of this sub-key.

[ Top ]

setLength   [line 518]

Crypt_GPG_SubKey setLength( integer $length)

Sets the length of this sub-key in bits
  • Return: the current object, for fluent interface.
  • Access: public

Parameters:

integer   $length     the length of this sub-key in bits.

[ Top ]

setRevoked   [line 587]

Crypt_GPG_SubKey setRevoked( boolean $isRevoked)

Sets whether or not this sub-key is revoked
  • Return: the current object, for fluent interface.
  • Access: public

Parameters:

boolean   $isRevoked     whether or not this sub-key is revoked.

[ Top ]


Documentation generated on Wed, 13 Mar 2013 18:30:12 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.