Namespace: \ParagonIE\Halite
A factory class responsible for the creation and persistence of cryptography keys.
public static
generateAuthenticationKey(&$secret_key = null
):AuthenticationKey
Generate an authentication key (symmetric-key cryptography).
public static
generateEncryptionKey(&$secret_key = null
):EncryptionKey
Generate an encryption key (symmetric-key cryptography).
public static
generateEncryptionKeyPair(&$secret_key = null
):EncryptionKeyPair
Generate a key pair for public key encryption.
public static
generateSignatureKeyPair(&$secret_key = null
):SignatureKeyPair
Generate a key pair for public key digital signatures.
public static
deriveAuthenticationKey(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 static
deriveEncryptionKey(HiddenString $password
,string $salt
,string $level
):EncryptionKey
Derive a symmetric encryption key from a password and salt.
public static
deriveEncryptionKeyPair(HiddenString $password
,string $salt
,string $level
):EncryptionKeyPair
Derive an asymmetric encryption key pair from a password and salt.
public static
deriveSignatureKeyPair(HiddenString $password
,string $salt
,string $level
):SignatureKeyPair
Derive an asymmetric signature key pair from a password and salt.
public static
loadAuthenticationKey(string $filePath
):AuthenticationKey
Load an AuthenticationKey
from a file.
public static
loadEncryptionKey(string $filePath
):EncryptionKey
Load an EncryptionKey
from a file.
public static
loadEncryptionKeyPair(string $filePath
):EncryptionKeyPair
Load an EncryptionKeyPair
from a file.
public static
loadSignatureKeyPair(string $filePath
):SignatureKeyPair
Load an SignatureKeyPair
from a file.
public static
save(Key|KeyPair $key
,string $filename = ''
)
Save a key to a file.