Class TestEnvelopeEncryptionService
java.lang.Object
org.j7m.middleware.crypto.policy.TestEnvelopeEncryptionService
- All Implemented Interfaces:
EnvelopeEncryptionService
public final class TestEnvelopeEncryptionService
extends Object
implements EnvelopeEncryptionService
Deterministic reversible envelope encryption fixture for tests and demos.
This is not cryptographic protection. It exists only to prove that the extension point can be exercised without exposing key material.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a deterministic envelope encryption fixture. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]decrypt(byte[] ciphertext, KeyReference keyReference) Decrypts a payload with an external key reference.byte[]encrypt(byte[] plaintext, KeyReference keyReference) Encrypts a payload with an external key reference.
-
Constructor Details
-
TestEnvelopeEncryptionService
public TestEnvelopeEncryptionService()Creates a deterministic envelope encryption fixture.
-
-
Method Details
-
encrypt
Encrypts a payload with an external key reference.- Specified by:
encryptin interfaceEnvelopeEncryptionService- Parameters:
plaintext- plaintext byteskeyReference- key reference- Returns:
- encrypted bytes
-
decrypt
Decrypts a payload with an external key reference.- Specified by:
decryptin interfaceEnvelopeEncryptionService- Parameters:
ciphertext- encrypted byteskeyReference- key reference- Returns:
- plaintext bytes
-