Interface Crypt_KeyStore_SPI_KeyStoreSPI

Description

This class defines the Service Provider Interface (SPI) for the KeyStore class. All the abstract methods in this class must be implemented by each cryptographic service provider who wishes to supply the implementation of a keystore for a particular keystore type.

Located in /Crypt/KeyStore/SPI/KeyStoreSPI.php (line 34)


	
			
Method Summary
array aliases ()
boolean containsAlias (string $alias)
string createCSR (string $alias, [string $password = false], [array $dn = array()], [array $options = array()])
void createSecretKey (string $alias, [array $password = false], [array $options = array()])
string decrypt (string $encData, string $alias, [string $password = false], [array $options = array()])
void deleteEntry (string $alias)
string encrypt (string $data, string $alias, [string $password = false], [array $options = array()])
boolean entryInstanceOf (string $alias, class $entryClazzName)
string getCertificateAlias (string $cert)
array getCertificateChain (string $alias)
DateTime getCreationDate (string $alias)
Crypt_KeyStore_Entry getEntry (string $alias, [array $options = false])
string getType ()
void importCertificate (string $cert, string $alias, [string $password = false])
boolean isCertificateEntry (string $alias)
boolean isKeyEntry (string $alias)
void load (string $filename, string $password, [array $options = array()])
string sign (string $data, string $alias, [string $password = false], [array $options = array()])
int size ()
void store (string $filename, string $password, [array $options = array()])
boolean verify (string $data, string $signature, string $alias, [array $options = array()])
Methods
aliases (line 41)

Lists all the alias names of this Crypt_KeyStore.

  • return: array of alias strings
  • access: public
array aliases ()
containsAlias (line 51)

Checks if the given alias exists in this Crypt_KeyStore.

  • return: true if the key store contains an entry with the alias, false if not
  • access: public
boolean containsAlias (string $alias)
  • string $alias: the alias of the entry to query
createCSR (line 175)

Creates a new private key and certificate signing request (CSR) for the private key. The CSR is returned for signing.

  • access: public
string createCSR (string $alias, [string $password = false], [array $dn = array()], [array $options = array()])
  • string $alias: alias to store new key/certificate under
  • string $password: password used to protect the private key
  • array $dn: distinguished name used to create CSR
  • array $options: array of key pair/certificate creation options
createSecretKey (line 162)

Creates a symmetric secret key from a randomly generated

pass phrase and stores the new key in the key store, protecting it with the password if specified. The pass phrase is a sequence of random hex numbers which is then used to generate the key using a SHA-256 hash and 8-bytes of salt.

  • access: public
void createSecretKey (string $alias, [array $password = false], [array $options = array()])
  • string $alias: the alias the new key will be stored as
  • array $password: password used to protected the key
  • array $options: array of key creation options
decrypt (line 218)

Decrypts the data with the key stored with the alias, optionally using the password to decrypt the key.

  • return: the encrypted data
  • access: public
string decrypt (string $encData, string $alias, [string $password = false], [array $options = array()])
  • string $encData: the encrypted data to decrypt
  • string $alias: the alias of the key to use to decrypt
  • string $password: the password to use to decrypt the key
  • array $options: array of decryption options
deleteEntry (line 60)

Deletes the entry identified by the given alias from this Crypt_KeyStore.

  • access: public
void deleteEntry (string $alias)
  • string $alias: the alias of the entry to delete
encrypt (line 205)

Encrypts the data with the key stored with the alias, optionally using the password to decrypt the key.

  • return: the encrypted data
  • access: public
string encrypt (string $data, string $alias, [string $password = false], [array $options = array()])
  • string $data: the plain text data to encrypt
  • string $alias: the alias of the key to use to encrypt
  • string $password: the password to use to decrypt the key
  • array $options: array of encryption options
entryInstanceOf (line 71)

Determines if the Crypt_KeyStore Entry for the specified alias is an instance or subclass of the specified entryClass.

  • return: true if entry is instance of the class name, false if not
  • access: public
boolean entryInstanceOf (string $alias, class $entryClazzName)
  • string $alias: the alias of the entry to test
  • class $entryClazzName: the key store entry class name to test
getCertificateAlias (line 81)

Returns the (alias) name of the first Crypt_KeyStore entry whose certificate matches the given certificate.

  • return: the alias of the certificate
  • access: public
string getCertificateAlias (string $cert)
  • string $cert: the certificate text
getCertificateChain (line 91)

Returns the certificate chain associated with the given alias.

  • return: an array of certificates in the chain, or NULL if the chain does not exist for the the alias
  • access: public
array getCertificateChain (string $alias)
  • string $alias: the alias of the certificate chain
getCreationDate (line 100)

Returns the creation date of the entry identified by the given alias.

  • return: the date/time the key was added to the key store
  • access: public
DateTime getCreationDate (string $alias)
  • string $alias: the alias of the entry to retrieve
getEntry (line 111)

Gets a Crypt_KeyStore Entry for the specified alias with the specified protection parameter.

  • access: public
Crypt_KeyStore_Entry getEntry (string $alias, [array $options = false])
  • string $alias: the alias of the entry to retrieve
  • array $options: the password used to decrypt the key
getType (line 118)

Returns the type of this Crypt_KeyStore.

  • return: the type of key store implementation
  • access: public
string getType ()
importCertificate (line 192)

Imports a signed-certificate into the key store assigning the alias to the new entry. If the alias is a pre-existing private key, the certificate must be valid and correspond to the private key. Otherwise, an exception is thrown.

  • access: public
void importCertificate (string $cert, string $alias, [string $password = false])
  • string $cert: the certificate to import
  • string $alias: the alias of the entry to import certificate into
  • string $password: private key password
isCertificateEntry (line 129)

Returns true if the entry identified by the given alias was created by a call to _setCertificateEntry, or created by a call to _setEntry with a Crypt_KeyStore_TrustedCertificateEntry.

  • return: true if entry is a certificate, false if not
  • access: public
boolean isCertificateEntry (string $alias)
  • string $alias: the alias of the entry to test
isKeyEntry (line 140)

Returns true if the entry identified by the given alias was created by a call to _setKeyEntry, or created by a call to _setEntry with a Crypt_KeyStore_PrivateKeyEntry or a Crypt_KeyStore_SecretKeyEntry.

  • return: true if entry is a key, false if not
  • access: public
boolean isKeyEntry (string $alias)
  • string $alias: the alias of the entry to test
load (line 254)

Loads this Crypt_KeyStore from the given input stream.

  • access: public
void load (string $filename, string $password, [array $options = array()])
  • string $filename: path and file name of key store file
  • string $password: password used encrypt key store
  • array $options: load options
sign (line 230)

Signs the data with the private key stored by the specified alias.

  • return: the signature
  • access: public
string sign (string $data, string $alias, [string $password = false], [array $options = array()])
  • string $data: the data to be signed
  • string $alias: the alias of the private key to use for signing
  • string $password: the password to unlock the private key
  • array $options: array of signing options
size (line 147)

Retrieves the number of entries in this Crypt_KeyStore.

  • return: the number of entries in the Crypt_KeyStore instance
  • access: public
int size ()
store (line 266)

Stores this Crypt_KeyStore to the given output stream, and protects its integrity with the given password.

  • access: public
void store (string $filename, string $password, [array $options = array()])
  • string $filename: path and file name of key store file
  • string $password: password used encrypt key store
  • array $options: store options
verify (line 243)

Verifies the signature was signed by the private key stored by the specified alias.

  • return: true if signature is valid, false if not
  • access: public
boolean verify (string $data, string $signature, string $alias, [array $options = array()])
  • string $data: the original data to verify signature against
  • string $signature: the signature to verify
  • string $alias: the alias of the private key
  • array $options: array of verification options

Documentation generated on Tue, 08 Jul 2008 14:52:10 -0500 by phpDocumentor 1.4.2