Enum Class HmacDataContentBuilder.Mode

java.lang.Object
java.lang.Enum<HmacDataContentBuilder.Mode>
zeroecho.sdk.builders.alg.HmacDataContentBuilder.Mode
All Implemented Interfaces:
Serializable, Comparable<HmacDataContentBuilder.Mode>, Constable
Enclosing class:
HmacDataContentBuilder

public static enum HmacDataContentBuilder.Mode extends Enum<HmacDataContentBuilder.Mode>
Mode selects whether the pipeline computes an HMAC tag or verifies one.

The active mode is set by HmacDataContentBuilder.mac() or HmacDataContentBuilder.verify() and governs how the builder interprets the selected output. In MAC mode, the pipeline produces or strips an HMAC trailer computed over the input. In VERIFY mode, the pipeline checks an expected tag supplied explicitly or taken from the input trailer.

Typical flows

// Compute HMAC and emit hex tag:
PlainContent c1 = HmacDataContentBuilder.builder()
    .mac()
    .sha256()
    .emitHexTag()
    .build(true);

// Verify HMAC carried as input trailer and pass the body through:
PlainContent c2 = HmacDataContentBuilder.builder()
    .verify()
    .sha256()
    .passThrough()
    .build(true);
Since:
1.0