\CryptoManana\CryptographicProtocolDigitalEnvelope

Class DigitalEnvelope - The digital envelope cryptographic protocol object.

Summary

Methods
Properties
Constants
setRandomGenerator()
getRandomGenerator()
setKeyedDigestionFunction()
getKeyedDigestionFunction()
setSymmetricCipher()
getSymmetricCipher()
setAsymmetricCipher()
getAsymmetricCipher()
__construct()
__destruct()
__clone()
sealEnvelope()
openEnvelope()
No public properties found
No constants found
No protected methods found
$randomnessSource
$keyedDigestionSource
$symmetricCipherSource
$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.

setKeyedDigestionFunction()

setKeyedDigestionFunction(\CryptoManana\Core\Abstractions\MessageDigestion\AbstractKeyedHashFunction  $hasher) : $this

Setter for the keyed message digestion service.

Parameters

\CryptoManana\Core\Abstractions\MessageDigestion\AbstractKeyedHashFunction $hasher

The keyed message digestion service or null.

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.

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.

__construct()

__construct(\CryptoManana\Core\Abstractions\MessageEncryption\AbstractAsymmetricEncryptionAlgorithm|\CryptoManana\Core\Interfaces\MessageEncryption\DataEncryptionInterface|null  $asymmetric = null, \CryptoManana\Core\Abstractions\MessageEncryption\AbstractBlockCipherAlgorithm|null  $symmetric = null) 

Container constructor.

Parameters

\CryptoManana\Core\Abstractions\MessageEncryption\AbstractAsymmetricEncryptionAlgorithm|\CryptoManana\Core\Interfaces\MessageEncryption\DataEncryptionInterface|null $asymmetric

The asymmetric message encryption service.

\CryptoManana\Core\Abstractions\MessageEncryption\AbstractBlockCipherAlgorithm|null $symmetric

the message encryption service.

Throws

\Exception

Initialization validation.

__destruct()

__destruct() 

Container destructor.

__clone()

__clone() 

Container cloning via deep copy.

sealEnvelope()

sealEnvelope(string  $plainData) : \CryptoManana\DataStructures\EnvelopeData

Seals the envelope with the secured information inside.

Parameters

string $plainData

The plain message information.

Throws

\Exception

Validation errors.

Returns

\CryptoManana\DataStructures\EnvelopeData

The sealed envelope object.

openEnvelope()

openEnvelope(\CryptoManana\DataStructures\EnvelopeData  $envelopeData) : string

Opens the envelope and extracts secured information from it.

Parameters

\CryptoManana\DataStructures\EnvelopeData $envelopeData

The sealed envelope object.

Throws

\Exception

Validation errors.

Returns

string —

The plain message information.