use of com.google.crypto.tink.subtle.AesGcmJce in project tink by google.
the class AesGcmKeyManager method getPrimitive.
/**
* @param key {@code AesGcmKey} proto
*/
@Override
public Aead getPrimitive(MessageLite key) throws GeneralSecurityException {
if (!(key instanceof AesGcmKey)) {
throw new GeneralSecurityException("expected AesGcmKey proto");
}
AesGcmKey keyProto = (AesGcmKey) key;
validate(keyProto);
return new AesGcmJce(keyProto.getKeyValue().toByteArray());
}
Aggregations