PHP Класс Horde_Crypt_Pgp_Backend, horde

NOTE: This class is NOT intended to be accessed outside of this package. There is NO guarantees that the API of this class will not change across versions.
Автор: Michael Slusarz ([email protected])
Показать файл Открыть проект

Открытые методы

Метод Описание
decryptMessage ( string $text, array $params ) : object Decrypts an PGP encrypted message using a private/public keypair and a passhprase.
decryptSignature ( string $text, array $params ) : object Decrypts an PGP signed message using a public key.
encryptMessage ( string $text, array $params ) : string Encrypts a message in PGP format using a public key.
encryptSignature ( string $text, array $params ) : string Signs a message in PGP format using a private key.
generateKey ( array $opts ) : mixed Generates a personal public/private keypair combination.
getFingerprintsFromKey ( string $pgpdata ) : array Get the fingerprints from a key block.
getPublicKeyFromPrivateKey ( string $data ) : string Generates a public key from a private key.
getSignersKeyId ( string $text ) : mixed Returns the key ID of the key used to sign a block of PGP data.
isEncryptedSymmetrically ( string $text ) : boolean Returns whether a text has been encrypted symmetrically.
packetInfo ( string $pgpdata ) : array Returns information on a PGP data block.
packetInfoMultiple ( string $pgpdata ) : array Returns all information on a PGP data block.
supported ( ) : boolean Is this driver supported?

Описание методов

decryptMessage() публичный Метод

Decrypts an PGP encrypted message using a private/public keypair and a passhprase.
public decryptMessage ( string $text, array $params ) : object
$text string The text to be decrypted.
$params array The parameters needed for decryption. - no_passphrase: Passphrase is not required. - passphrase: Passphrase for PGP Key. (REQUIRED, see no_passphrase) - privkey: PGP private key. (REQUIRED for asymmetric encryption) - pubkey: PGP public key. (REQUIRED for asymmetric encryption) - type: [REQUIRED] 'message'
Результат object An object with the following properties: - message: (string) The signature result text. - result: (boolean) The result of the signature test.

decryptSignature() публичный Метод

Decrypts an PGP signed message using a public key.
public decryptSignature ( string $text, array $params ) : object
$text string The text to be verified.
$params array The parameters needed for verification. - charset: Charset of the message body. - pubkey: [REQUIRED] PGP public key. - signature: PGP signature block. (REQUIRED for detached signature) - type: [REQUIRED] 'signature' or 'detached-signature'
Результат object An object with the following properties: - message: (string) The signature result text. - result: (boolean) The result of the signature test.

encryptMessage() публичный Метод

Encrypts a message in PGP format using a public key.
public encryptMessage ( string $text, array $params ) : string
$text string The text to be encrypted.
$params array The parameters needed for encryption. - passphrase: The passphrase for the symmetric encryption (REQUIRED if 'symmetric' is true) - recips: An array with the e-mail address of the recipient as the key and that person's public key as the value. (REQUIRED if 'symmetric' is false) - symmetric: Whether to use symmetric instead of asymmetric encryption (defaults to false). - type: [REQUIRED] 'message'
Результат string The encrypted message.

encryptSignature() публичный Метод

Signs a message in PGP format using a private key.
public encryptSignature ( string $text, array $params ) : string
$text string The text to be signed.
$params array The parameters needed for signing. - passphrase: [REQUIRED] Passphrase for PGP Key. - privkey: [REQUIRED] PGP private key. - pubkey: [REQUIRED] PGP public key. - sigtype: Determine the signature type to use. - 'cleartext': Make a clear text signature - 'detach': Make a detached signature (DEFAULT) - type: [REQUIRED] 'signature'
Результат string The signed message.

generateKey() публичный Метод

Generates a personal public/private keypair combination.
public generateKey ( array $opts ) : mixed
$opts array Configuration: - comment: (string) The comment to use. - email: (string) The email to use. - expire: (integer) The expiration date (UNIX timestamp). No expiration if empty. - keylength: (integer) The keylength to use. - key_type: (string) Key type. - name: (string) The name to use. - passphrase: (string) The passphrase to use. - subkey_type: (string) Subkey type.
Результат mixed False on error; an array on success consisting of the following keys/values: - private: (string) Private key. - public: (string) Public key.

getFingerprintsFromKey() публичный Метод

Get the fingerprints from a key block.
public getFingerprintsFromKey ( string $pgpdata ) : array
$pgpdata string The PGP data block.
Результат array The fingerprints in $pgpdata indexed by key id.

getPublicKeyFromPrivateKey() публичный Метод

Generates a public key from a private key.
public getPublicKeyFromPrivateKey ( string $data ) : string
$data string Armor text of private key.
Результат string Armor text of public key.

getSignersKeyId() публичный Метод

Returns the key ID of the key used to sign a block of PGP data.
public getSignersKeyId ( string $text ) : mixed
$text string The PGP signed text block.
Результат mixed The key ID of the key used to sign $text.

isEncryptedSymmetrically() публичный Метод

Returns whether a text has been encrypted symmetrically.
public isEncryptedSymmetrically ( string $text ) : boolean
$text string The PGP encrypted text.
Результат boolean True if the text is symmetrically encrypted.

packetInfo() публичный Метод

Returns information on a PGP data block.
public packetInfo ( string $pgpdata ) : array
$pgpdata string The PGP data block.
Результат array An array with information on the PGP data block. {@see \Horde_Crypt_Pgp::pgpPacketInformation()}

packetInfoMultiple() публичный Метод

Returns all information on a PGP data block.
public packetInfoMultiple ( string $pgpdata ) : array
$pgpdata string The PGP data block.
Результат array An array with information on the PGP data block. {@see \Horde_Crypt_Pgp::pgpPacketInformationMultiple()}

supported() публичный статический Метод

Is this driver supported?
public static supported ( ) : boolean
Результат boolean True if supported.