Package com.google.crypto.tink
Class KeysetHandle.Builder.Entry
- java.lang.Object
-
- com.google.crypto.tink.KeysetHandle.Builder.Entry
-
- Enclosing class:
- KeysetHandle.Builder
public static final class KeysetHandle.Builder.Entry extends java.lang.ObjectOne entry, representing a single key, in a Keyset.Builder.This is the analogue of
Keyset.Entryfor a builder.Users will have to ensure that each entry has an ID, and one entry is a primary. See
KeysetHandle.Builder.build()for details).
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KeyStatusgetStatus()Returns the status of this entry.booleanisPrimary()Returns whether this entry has been marked as a primary.KeysetHandle.Builder.EntrymakePrimary()Marks that this entry is the primary key.KeysetHandle.Builder.EntrysetStatus(KeyStatus status)Sets the status of this entry.KeysetHandle.Builder.EntrywithFixedId(int id)Tells Tink to assign a fixed id when this keyset is built.KeysetHandle.Builder.EntrywithRandomId()Tells Tink to assign an unused uniform random id when this keyset is built.
-
-
-
Method Detail
-
makePrimary
@CanIgnoreReturnValue public KeysetHandle.Builder.Entry makePrimary()
Marks that this entry is the primary key.Other entries in the same keyset will be marked as non-primary if this Entry has already been added to a builder, otherwise they will marked as non-primary once this entry is added to a builder.
-
isPrimary
public boolean isPrimary()
Returns whether this entry has been marked as a primary.
-
setStatus
@CanIgnoreReturnValue public KeysetHandle.Builder.Entry setStatus(KeyStatus status)
Sets the status of this entry.
-
getStatus
public KeyStatus getStatus()
Returns the status of this entry.
-
withFixedId
@CanIgnoreReturnValue public KeysetHandle.Builder.Entry withFixedId(int id)
Tells Tink to assign a fixed id when this keyset is built.
-
withRandomId
@CanIgnoreReturnValue public KeysetHandle.Builder.Entry withRandomId()
Tells Tink to assign an unused uniform random id when this keyset is built.Using
withRandomIdis invalid for an entry with an imported or preexisting key, which has an ID requirement.If an entry is marked as
withRandomId, all subsequent entries also need to be marked withwithRandomId, or else callingbuild()will fail.
-
-