PHP 클래스 IMP_Smime, horde

저자: Mike Cochrane ([email protected])
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_smime Horde_Crypt_Smime S/MIME object.

공개 메소드들

메소드 설명
__construct ( Horde_Crypt_Smime $smime ) Constructor.
addAdditionalCert ( string | array $key, boolean $signkey = false ) Adds a list of additional certs to the prefs.
addFromPKCS12 ( string $pkcs12, string $password, string $pkpass = null, boolean $signkey = false ) Stores the public/private/additional certificates in the preferences from a given PKCS 12 file.
addPersonalPrivateKey ( string | array $key, boolean $signkey = false ) Adds the personal private key to the prefs.
addPersonalPublicKey ( string | array $key, boolean $signkey = false ) Adds the personal public key to the prefs.
addPublicKey ( string $cert ) Adds a public key to an address book.
certToHTML ( string $cert ) : string Converts a PEM format certificate to readable HTML version.
checkForOpenSsl ( ) Checks for the presence of the OpenSSL extension to PHP.
decryptMessage ( string $text ) : string Decrypts a message with user's public/private keypair.
deletePersonalKeys ( boolean $signkey = false ) Deletes the specified personal keys from the prefs.
deletePublicKey ( string $email ) Deletes a public key from a user's address book(s) by e-mail.
enabled ( ) : boolean Return whether PGP support is current enabled in IMP.
encryptList ( ) : array Returns the list of available encryption options for composing.
encryptMimePart ( Horde_Mime_Part $mime_part, Horde_Mail_Rfc822_List $recip ) : Horde_Mime_Part Encrypts a MIME part using S/MIME using IMP defaults.
extractSignedContents ( string $data ) : string Extracts the contents from signed S/MIME data.
getAdditionalCert ( integer $signkey = self::KEY_PRIMARY ) : string Returns any additional certificates from the prefs.
getPassphrase ( integer $signkey = self::KEY_PRIMARY ) : mixed Returns the user's passphrase from the session cache.
getPersonalPrivateKey ( integer $signkey = self::KEY_PRIMARY ) : string Returns the personal private key from the prefs.
getPersonalPublicKey ( integer $signkey = self::KEY_PRIMARY ) : string Returns the personal public key from the prefs.
getPublicKey ( string $address ) : string Retrieves a public key by e-mail.
listPublicKeys ( ) : array Retrieves all public keys from a user's address book(s).
parseCert ( string $cert ) : array Extracts the contents of a PEM format certificate to an array.
publicKeyInfo ( string $cert ) : array Returns information about a public certificate.
signAndEncryptMimePart ( Horde_Mime_Part $mime_part, Horde_Mail_Rfc822_List $recip ) : Horde_Mime_Part Signs and encrypts a MIME part using S/MIME using IMP defaults.
signMimePart ( MIME_Part $mime_part ) : Horde_Mime_Part Signs a MIME part using S/MIME using IMP defaults.
storePassphrase ( string $passphrase, integer $signkey = self::KEY_PRIMARY ) : boolean Stores the user's passphrase in the session cache.
unsetPassphrase ( boolean $signkey = false ) Clears the passphrase from the session cache.
verifySignature ( string $text ) : stdClass Verifies a signed message with a given public key.

보호된 메소드들

메소드 설명
_encryptParameters ( Horde_Mail_Rfc822_List $addr ) : array Returns the params needed to encrypt a message being sent to the specified email address(es).
_signParameters ( ) : array Returns the parameters needed for signing a message.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( Horde_Crypt_Smime $smime )
$smime Horde_Crypt_Smime

_encryptParameters() 보호된 메소드

Returns the params needed to encrypt a message being sent to the specified email address(es).
protected _encryptParameters ( Horde_Mail_Rfc822_List $addr ) : array
$addr Horde_Mail_Rfc822_List The recipient addresses.
리턴 array The list of parameters needed by encrypt().

_signParameters() 보호된 메소드

Returns the parameters needed for signing a message.
protected _signParameters ( ) : array
리턴 array The list of parameters needed by encrypt().

addAdditionalCert() 공개 메소드

Adds a list of additional certs to the prefs.
public addAdditionalCert ( string | array $key, boolean $signkey = false )
$key string | array The additional certifcate(s) to add.
$signkey boolean Is this the secondary key for signing?

addFromPKCS12() 공개 메소드

Stores the public/private/additional certificates in the preferences from a given PKCS 12 file.
public addFromPKCS12 ( string $pkcs12, string $password, string $pkpass = null, boolean $signkey = false )
$pkcs12 string The PKCS 12 data.
$password string The password of the PKCS 12 file.
$pkpass string The password to use to encrypt the private key.
$signkey boolean Is this the secondary key for signing?

addPersonalPrivateKey() 공개 메소드

Adds the personal private key to the prefs.
public addPersonalPrivateKey ( string | array $key, boolean $signkey = false )
$key string | array The private key to add.
$signkey boolean Is this the secondary key for signing?

addPersonalPublicKey() 공개 메소드

Adds the personal public key to the prefs.
public addPersonalPublicKey ( string | array $key, boolean $signkey = false )
$key string | array The public key to add.
$signkey boolean Is this the secondary key for signing?

addPublicKey() 공개 메소드

Adds a public key to an address book.
public addPublicKey ( string $cert )
$cert string A public certificate to add.

certToHTML() 공개 메소드

Converts a PEM format certificate to readable HTML version.
public certToHTML ( string $cert ) : string
$cert string PEM format certificate.
리턴 string HTML detailing the certificate.

checkForOpenSsl() 공개 메소드

Checks for the presence of the OpenSSL extension to PHP.
public checkForOpenSsl ( )

decryptMessage() 공개 메소드

Decrypts a message with user's public/private keypair.
public decryptMessage ( string $text ) : string
$text string The text to decrypt.
리턴 string See Horde_Crypt_Smime::decrypt().

deletePersonalKeys() 공개 메소드

Deletes the specified personal keys from the prefs.
public deletePersonalKeys ( boolean $signkey = false )
$signkey boolean Return the secondary key for signing?

deletePublicKey() 공개 메소드

Deletes a public key from a user's address book(s) by e-mail.
public deletePublicKey ( string $email )
$email string The e-mail address to delete.

enabled() 공개 정적인 메소드

Return whether PGP support is current enabled in IMP.
public static enabled ( ) : boolean
리턴 boolean True if PGP support is enabled.

encryptList() 공개 메소드

Returns the list of available encryption options for composing.
public encryptList ( ) : array
리턴 array Keys are encryption type constants, values are gettext strings describing the encryption type.

encryptMimePart() 공개 메소드

Encrypts a MIME part using S/MIME using IMP defaults.
public encryptMimePart ( Horde_Mime_Part $mime_part, Horde_Mail_Rfc822_List $recip ) : Horde_Mime_Part
$mime_part Horde_Mime_Part The object to encrypt.
$recip Horde_Mail_Rfc822_List The recipient address(es).
리턴 Horde_Mime_Part See Horde_Crypt_Smime::encryptMIMEPart().

extractSignedContents() 공개 메소드

Extracts the contents from signed S/MIME data.
public extractSignedContents ( string $data ) : string
$data string The signed S/MIME data.
리턴 string The contents embedded in the signed data.

getAdditionalCert() 공개 메소드

Returns any additional certificates from the prefs.
public getAdditionalCert ( integer $signkey = self::KEY_PRIMARY ) : string
$signkey integer One of the IMP_Sime::KEY_* constants.
리턴 string Additional signing certs for inclusion.

getPassphrase() 공개 메소드

Returns the user's passphrase from the session cache.
public getPassphrase ( integer $signkey = self::KEY_PRIMARY ) : mixed
$signkey integer One of the IMP_Sime::KEY_* constants.
리턴 mixed The passphrase, if set. Returns false if the passphrase has not been loaded yet. Returns null if no passphrase is needed.

getPersonalPrivateKey() 공개 메소드

Returns the personal private key from the prefs.
public getPersonalPrivateKey ( integer $signkey = self::KEY_PRIMARY ) : string
$signkey integer One of the IMP_Sime::KEY_* constants.
리턴 string The personal S/MIME private key.

getPersonalPublicKey() 공개 메소드

Returns the personal public key from the prefs.
public getPersonalPublicKey ( integer $signkey = self::KEY_PRIMARY ) : string
$signkey integer One of the IMP_Sime::KEY_* constants.
리턴 string The personal S/MIME public key.

getPublicKey() 공개 메소드

The key will be retrieved from a user's address book(s).
public getPublicKey ( string $address ) : string
$address string The e-mail address to search for.
리턴 string The S/MIME public key requested.

listPublicKeys() 공개 메소드

Retrieves all public keys from a user's address book(s).
public listPublicKeys ( ) : array
리턴 array All S/MIME public keys available.

parseCert() 공개 메소드

Extracts the contents of a PEM format certificate to an array.
public parseCert ( string $cert ) : array
$cert string PEM format certificate.
리턴 array All extractable information about the certificate.

publicKeyInfo() 공개 메소드

Returns information about a public certificate.
public publicKeyInfo ( string $cert ) : array
$cert string The public certificate.
리턴 array Two element array: the name and e-mail for the cert.

signAndEncryptMimePart() 공개 메소드

Signs and encrypts a MIME part using S/MIME using IMP defaults.
public signAndEncryptMimePart ( Horde_Mime_Part $mime_part, Horde_Mail_Rfc822_List $recip ) : Horde_Mime_Part
$mime_part Horde_Mime_Part The object to sign and encrypt.
$recip Horde_Mail_Rfc822_List The recipient address(es).
리턴 Horde_Mime_Part See Horde_Crypt_Smime::signAndencryptMIMEPart().

signMimePart() 공개 메소드

Signs a MIME part using S/MIME using IMP defaults.
public signMimePart ( MIME_Part $mime_part ) : Horde_Mime_Part
$mime_part MIME_Part The MIME_Part object to sign.
리턴 Horde_Mime_Part See Horde_Crypt_Smime::signMIMEPart().

storePassphrase() 공개 메소드

Stores the user's passphrase in the session cache.
public storePassphrase ( string $passphrase, integer $signkey = self::KEY_PRIMARY ) : boolean
$passphrase string The user's passphrase.
$signkey integer One of the IMP_Sime::KEY_* constants.
리턴 boolean Returns true if correct passphrase, false if incorrect.

unsetPassphrase() 공개 메소드

Clears the passphrase from the session cache.
public unsetPassphrase ( boolean $signkey = false )
$signkey boolean Is this the secondary key for signing?

verifySignature() 공개 메소드

Verifies a signed message with a given public key.
public verifySignature ( string $text ) : stdClass
$text string The text to verify.
리턴 stdClass See Horde_Crypt_Smime::verify().

프로퍼티 상세

$_smime 보호되어 있는 프로퍼티

S/MIME object.
protected Horde_Crypt_Smime $_smime
리턴 Horde_Crypt_Smime