Package com.google.crypto.tink
Class KeysetHandle.Entry
- java.lang.Object
-
- com.google.crypto.tink.KeysetHandle.Entry
-
- All Implemented Interfaces:
KeysetHandleInterface.Entry
- Enclosing class:
- KeysetHandle
@Immutable public static final class KeysetHandle.Entry extends java.lang.Object implements KeysetHandleInterface.Entry
Represents a single entry in a keyset.An entry in a keyset consists of a key, its ID, and the
KeyStatus. In addition, there is one key marked as a primary.The ID should be considered unique (though currently Tink still accepts keysets with repeated IDs). The
KeyStatustells Tink whether the key should still be used or not. There should always be exactly one key which is marked as a primary, however, at the moment Tink still accepts keysets which have none. This will be changed in the future.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetId()KeygetKey()May return an internal classLegacyProtoKeyin case there is no implementation of the corresponding key class yet.KeyStatusgetStatus()booleanisPrimary()Guaranteed to be true in exactly one entry.
-
-
-
Method Detail
-
getKey
public Key getKey()
May return an internal classLegacyProtoKeyin case there is no implementation of the corresponding key class yet.- Specified by:
getKeyin interfaceKeysetHandleInterface.Entry
-
getStatus
public KeyStatus getStatus()
- Specified by:
getStatusin interfaceKeysetHandleInterface.Entry
-
getId
public int getId()
- Specified by:
getIdin interfaceKeysetHandleInterface.Entry
-
isPrimary
public boolean isPrimary()
Guaranteed to be true in exactly one entry.Note: currently this may be false for all entries, since it is possible that keysets are parsed without a primary. In the future, such keysets will be rejected when the keyset is parsed.
- Specified by:
isPrimaryin interfaceKeysetHandleInterface.Entry
-
-