Namespace: \ParagonIE\Halite
A factory class responsible for the creation and persistence of cryptography keys.
public staticgenerateAuthenticationKey(&$secret_key = null):AuthenticationKey
Generate an authentication key (symmetric-key cryptography).
public staticgenerateEncryptionKey(&$secret_key = null):EncryptionKey
Generate an encryption key (symmetric-key cryptography).
public staticgenerateEncryptionKeyPair(&$secret_key = null):EncryptionKeyPair
Generate a key pair for public key encryption.
public staticgenerateSignatureKeyPair(&$secret_key = null):SignatureKeyPair
Generate a key pair for public key digital signatures.
public staticderiveAuthenticationKey(HiddenString $password,string $salt,string $level):AuthenticationKey
Derive a symmetric authentication key from a password and salt.
Acceptable values for $level:
KeyFactory::INTERACTIVE- defaultKeyFactory::MODERATE- takes one to two seconds (depending on hardware)KeyFactory::SENSITIVE- takes several seconds; recommended for mission critical cryptography keys
public staticderiveEncryptionKey(HiddenString $password,string $salt,string $level):EncryptionKey
Derive a symmetric encryption key from a password and salt.
public staticderiveEncryptionKeyPair(HiddenString $password,string $salt,string $level):EncryptionKeyPair
Derive an asymmetric encryption key pair from a password and salt.
public staticderiveSignatureKeyPair(HiddenString $password,string $salt,string $level):SignatureKeyPair
Derive an asymmetric signature key pair from a password and salt.
public staticloadAuthenticationKey(string $filePath):AuthenticationKey
Load an AuthenticationKey from a file.
public staticloadEncryptionKey(string $filePath):EncryptionKey
Load an EncryptionKey from a file.
public staticloadEncryptionKeyPair(string $filePath):EncryptionKeyPair
Load an EncryptionKeyPair from a file.
public staticloadSignatureKeyPair(string $filePath):SignatureKeyPair
Load an SignatureKeyPair from a file.
public staticsave(Key|KeyPair $key,string $filename = '')
Save a key to a file.