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

Class: Crypt_GPG_SubKey

Source Location: /Crypt_GPG-1.6.4/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 53]
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 209]

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.
  • integer usage - the sub-key usage flags
  • 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 386]

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 372]

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 301]

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 316]

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 332]

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 345]

string getFingerprint( )

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

[ Top ]

getId   [line 285]

string getId( )

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

[ Top ]

getLength   [line 358]

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 414]

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 427]

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 642]

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 495]

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 566]

Crypt_GPG_SubKey setCanEncrypt( boolean $canEncrypt)

Sets whether or 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 544]

Crypt_GPG_SubKey setCanSign( boolean $canSign)

Sets whether or 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 444]

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 463]

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 511]

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 606]

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 479]

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 527]

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 622]

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 ]

setUsage   [line 587]

Crypt_GPG_SubKey setUsage( integer $usage)

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

Parameters:

integer   $usage   —  Usage flags

[ Top ]

usage   [line 399]

int usage( )

Gets usage flags of this sub-key
  • Return: Sum of usage flags
  • Access: public

[ Top ]


Documentation generated on Sun, 22 Mar 2020 08:01:07 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.