\CryptoManana\CryptographicProtocolPublicKeyAuthentication

Class PublicKeyAuthentication - The asymmetric/public key authentication protocol object.

Summary

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

Properties

$asymmetricCipherSource

$asymmetricCipherSource : \CryptoManana\Core\Abstractions\MessageEncryption\AbstractAsymmetricEncryptionAlgorithm|\CryptoManana\Core\Interfaces\MessageEncryption\DataEncryptionInterface|null

The message asymmetric encryption algorithm service property storage.

Type

\CryptoManana\Core\Abstractions\MessageEncryption\AbstractAsymmetricEncryptionAlgorithm|\CryptoManana\Core\Interfaces\MessageEncryption\DataEncryptionInterface|null — The message asymmetric encryption service.

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.

setAsymmetricCipher()

setAsymmetricCipher(\CryptoManana\Core\Abstractions\MessageEncryption\AbstractAsymmetricEncryptionAlgorithm|\CryptoManana\Core\Interfaces\MessageEncryption\DataEncryptionInterface  $cipher) : $this

Setter for the message asymmetric encryption service.

Parameters

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

The message asymmetric encryption service.

Returns

$this —

The container object.

getAsymmetricCipher()

getAsymmetricCipher() : \CryptoManana\Core\Abstractions\MessageEncryption\AbstractAsymmetricEncryptionAlgorithm|\CryptoManana\Core\Interfaces\MessageEncryption\DataEncryptionInterface|null

Getter for the message asymmetric encryption service.

Returns

\CryptoManana\Core\Abstractions\MessageEncryption\AbstractAsymmetricEncryptionAlgorithm|\CryptoManana\Core\Interfaces\MessageEncryption\DataEncryptionInterface|null —

The currently injected message encryption service or null.

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.