public final class PrimitiveSet<P> extends Object
It provides also additional properties for the primitives it holds. In particular, one of the primitives in the set can be distinguished as "the primary" one.
PrimitiveSet is an auxiliary class used for supporting key rotation: primitives in a set correspond to keys in a keyset. Users will usually work with primitive instances, which essentially wrap primitive sets. For example an instance of an Aead-primitive for a given keyset holds a set of Aead-primitives corresponding to the keys in the keyset, and uses the set members to do the actual crypto operations: to encrypt data the primary Aead-primitive from the set is used, and upon decryption the ciphertext's prefix determines the id of the primitive from the set.
| Modifier and Type | Class and Description |
|---|---|
static class |
PrimitiveSet.Builder<P>
Builds an immutable PrimitiveSet.
|
static class |
PrimitiveSet.Entry<P>
A single entry in the set.
|
| Modifier and Type | Method and Description |
|---|---|
MonitoringAnnotations |
getAnnotations() |
KeysetHandleInterface |
getKeysetHandle() |
Class<P> |
getPrimitiveClass() |
P |
getPrimitiveForEntry(KeysetHandleInterface.Entry entry) |
static <P> PrimitiveSet.Builder<P> |
newBuilder(Class<P> primitiveClass) |
public MonitoringAnnotations getAnnotations()
public KeysetHandleInterface getKeysetHandle()
public P getPrimitiveForEntry(KeysetHandleInterface.Entry entry) throws GeneralSecurityException
GeneralSecurityExceptionpublic static <P> PrimitiveSet.Builder<P> newBuilder(Class<P> primitiveClass)