\CryptoManana\Core\Traits\MessageEncryptionObjectEncryptionTrait

Trait ObjectEncryptionTrait - Reusable implementation of `ObjectEncryptionInterface`.

Summary

Methods
Properties
Constants
encryptObject()
decryptObject()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

encryptObject()

encryptObject(object|\stdClass  $object) : string

Encrypts the serialized value of the given object.

Parameters

object|\stdClass $object

The object for encryption.

Throws

\Exception

Validation errors.

Returns

string —

The encrypted serialized object as a string.

decryptObject()

decryptObject(string  $cipherData) : object|\stdClass

Decrypts the encrypted value of the given object.

Parameters

string $cipherData

The encrypted serialized object as a string.

Throws

\Exception

Validation errors.

Returns

object|\stdClass —

The decrypted and unserialized object.