\Defuse\CryptoKeyOrPassword

Summary

Methods
Properties
Constants
createFromKey()
createFromPassword()
deriveKeys()
No public properties found
PBKDF2_ITERATIONS
SECRET_TYPE_KEY
SECRET_TYPE_PASSWORD
No protected methods found
No protected properties found
N/A
__construct()
$secret_type
$secret
N/A

Constants

PBKDF2_ITERATIONS

PBKDF2_ITERATIONS

SECRET_TYPE_KEY

SECRET_TYPE_KEY

SECRET_TYPE_PASSWORD

SECRET_TYPE_PASSWORD

Properties

$secret_type

$secret_type : integer

Type

integer

Methods

createFromPassword()

createFromPassword(string  $password) : \Defuse\Crypto\KeyOrPassword

Initializes an instance of KeyOrPassword from a password.

Parameters

string $password

Returns

\Defuse\Crypto\KeyOrPassword

deriveKeys()

deriveKeys(string  $salt) : \Defuse\Crypto\DerivedKeys

Derives authentication and encryption keys from the secret, using a slow key derivation function if the secret is a password.

Parameters

string $salt

Throws

\Defuse\Crypto\Exception\CryptoException
\Defuse\Crypto\Exception\EnvironmentIsBrokenException

Returns

\Defuse\Crypto\DerivedKeys

__construct()

__construct(integer  $secret_type, mixed  $secret) 

Constructor for KeyOrPassword.

Parameters

integer $secret_type
mixed $secret

(either a Key or a password string)