Class RecipientKekSizes
java.lang.Object
zeroecho.sdk.guard.RecipientKekSizes
Defines the KEK sizes supported by recipient entries without an encoded size
discriminator.
The current recipient format permits AES-128 and AES-256 wrapping only. Validation must occur before an entry is registered so every emitted entry remains openable by the corresponding recipient opener.
- Since:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intAES-128 key size in bytes.static final intAES-256 key size in bytes. -
Method Summary
Modifier and TypeMethodDescriptionstatic intrequireSupported(int kekBytes) Validates and returns a supported recipient KEK size.
-
Field Details
-
AES_128_BYTES
public static final int AES_128_BYTESAES-128 key size in bytes.- See Also:
-
AES_256_BYTES
public static final int AES_256_BYTESAES-256 key size in bytes.- See Also:
-
-
Method Details
-
requireSupported
public static int requireSupported(int kekBytes) Validates and returns a supported recipient KEK size.- Parameters:
kekBytes- requested KEK size in bytes- Returns:
kekByteswhen it is exactly 16 or 32- Throws:
IllegalArgumentException- if the size is not exactly 16 or 32
-