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 Details

    • TestEnvelopeEncryptionService

      public TestEnvelopeEncryptionService()
      Creates a deterministic envelope encryption fixture.
  • Method Details

    • encrypt

      public byte[] encrypt(byte[] plaintext, KeyReference keyReference)
      Encrypts a payload with an external key reference.
      Specified by:
      encrypt in interface EnvelopeEncryptionService
      Parameters:
      plaintext - plaintext bytes
      keyReference - key reference
      Returns:
      encrypted bytes
    • decrypt

      public byte[] decrypt(byte[] ciphertext, KeyReference keyReference)
      Decrypts a payload with an external key reference.
      Specified by:
      decrypt in interface EnvelopeEncryptionService
      Parameters:
      ciphertext - encrypted bytes
      keyReference - key reference
      Returns:
      plaintext bytes