@CheckReturnValue @Alpha @Immutable public final class SecretKeyAccess extends Object
Tink restricts access to secret key material, and users who require such access need to have
an object of the class SecretKeyAccess to do this. For example, a function that outputs
individiual key bytes might look like this:
class HmacKey {
...
public byte[] getKeyMaterial(SecretKeyAccess access) {
checkNotNull(access);
return keyMaterial;
}
}
Users who want to call getKeyMaterial then need to get a SecretKeyAccess object
via InsecureSecretKeyAccess.get().| Modifier and Type | Method and Description |
|---|---|
static SecretKeyAccess |
requireAccess(SecretKeyAccess access)
Throws an exception if the passed in SecretKeyAccess is null, otherwise returns it.
|
@CanIgnoreReturnValue public static SecretKeyAccess requireAccess(@Nullable SecretKeyAccess access) throws GeneralSecurityException
GeneralSecurityException