Add key accessing functions to KeysetHandle.
We add a static inner class KeysetHandle.Entry as well as methods
* getPrimary()
* size()
* getAt(i)
These return the size of the keyset, as well as corresponding entries.
In entries, users can query "getKey()", "getStatus()", "getId()", as well as "isPrimary()".
Note: these functions should never throw, but currently Tink accepts keysets without primary and with invalid status objects. In these cases, we may throw.
The function getKey will, in the future, return a Key object which can be used to query information about the key (including key material). However, currently it only returns an internal object (LegacyProtoKey).
PiperOrigin-RevId: 455359595
Change-Id: I4595d3b98755ae0dce630ddb8eb2c32b121c6b5d
4 files changed