\CryptoManana\CryptographicProtocolSymmetricKeyAuthentication

Class SymmetricKeyAuthentication - The symmetric key authentication protocol object.

Summary

Methods
Properties
Constants
setRandomGenerator()
getRandomGenerator()
setSymmetricCipher()
getSymmetricCipher()
identifyEntity()
authenticateEntity()
generateAuthenticationToken()
extractAuthenticationToken()
__construct()
__destruct()
__clone()
No public properties found
No constants found
No protected methods found
$randomnessSource
$symmetricCipherSource
N/A
No private methods found
No private properties found
N/A

Properties

Methods

setRandomGenerator()

setRandomGenerator(\CryptoManana\Core\Abstractions\Randomness\AbstractGenerator  $generator) : $this

Setter for the pseudo-random generator service.

Parameters

\CryptoManana\Core\Abstractions\Randomness\AbstractGenerator $generator

The pseudo-random generator service.

Returns

$this —

The container object.

setSymmetricCipher()

setSymmetricCipher(\CryptoManana\Core\Abstractions\MessageEncryption\AbstractBlockCipherAlgorithm|\CryptoManana\Core\Interfaces\MessageEncryption\DataEncryptionInterface  $cipher) : $this

Setter for the message symmetric encryption service.

Parameters

\CryptoManana\Core\Abstractions\MessageEncryption\AbstractBlockCipherAlgorithm|\CryptoManana\Core\Interfaces\MessageEncryption\DataEncryptionInterface $cipher

The message symmetric encryption service.

Returns

$this —

The container object.

identifyEntity()

identifyEntity(string  $correctIdentification, string  $suppliedIdentification) : boolean

Verify the identity of a user or a client entity.

Parameters

string $correctIdentification

The correct identification information.

string $suppliedIdentification

The supplied identification information.

Throws

\Exception

Validation errors.

Returns

boolean —

The identity verification result.

authenticateEntity()

authenticateEntity(string  $correctPassphrase, string  $suppliedPassphrase) : boolean

Authenticate a user or a client entity.

Parameters

string $correctPassphrase

The correct passphrase information.

string $suppliedPassphrase

The supplied passphrase information.

Throws

\Exception

Validation errors.

Returns

boolean —

The identity authentication result.

generateAuthenticationToken()

generateAuthenticationToken(integer  $length = 64) : \CryptoManana\DataStructures\AuthenticationToken

Generate a secure token and create an encrypt representation.

Parameters

integer $length

The desired output string length in bytes (default => 64).

Throws

\Exception

Validation errors.

Returns

\CryptoManana\DataStructures\AuthenticationToken

The authentication token data structure object.

extractAuthenticationToken()

extractAuthenticationToken(string  $cipherToken) : string

Extracts the token from the cipher data via a predefined configuration.

Parameters

string $cipherToken

The encrypted token string.

Throws

\Exception

Validation errors.

Returns

string —

The decrypted authentication token.

__destruct()

__destruct() 

Container destructor.

__clone()

__clone() 

Container cloning via deep copy.