@Immutable public static final class KeysetHandle.Entry extends Object implements KeysetHandleInterface.Entry
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 KeyStatus tells 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.
| Modifier and Type | Method and Description |
|---|---|
int |
getId() |
Key |
getKey()
May return an internal class
LegacyProtoKey in case
there is no implementation of the corresponding key class yet. |
KeyStatus |
getStatus() |
boolean |
isPrimary()
Guaranteed to be true in exactly one entry.
|
public Key getKey()
LegacyProtoKey in case
there is no implementation of the corresponding key class yet.getKey in interface KeysetHandleInterface.Entrypublic KeyStatus getStatus()
getStatus in interface KeysetHandleInterface.Entrypublic int getId()
getId in interface KeysetHandleInterface.Entrypublic boolean isPrimary()
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.
isPrimary in interface KeysetHandleInterface.Entry