use of com.google.crypto.tink.proto.AesGcmKeyFormat in project tink by google.
the class AeadKeyTemplatesTest method testAES256_GCM.
@Test
public void testAES256_GCM() throws Exception {
KeyTemplate template = AeadKeyTemplates.AES256_GCM;
assertEquals(AesGcmKeyManager.TYPE_URL, template.getTypeUrl());
assertEquals(OutputPrefixType.TINK, template.getOutputPrefixType());
AesGcmKeyFormat format = AesGcmKeyFormat.parseFrom(template.getValue());
assertEquals(32, format.getKeySize());
}
use of com.google.crypto.tink.proto.AesGcmKeyFormat in project tink by google.
the class AeadKeyTemplatesTest method aes256Gcm.
@Test
public void aes256Gcm() throws Exception {
KeyTemplate template = AeadKeyTemplates.AES256_GCM;
assertEquals(new AesGcmKeyManager().getKeyType(), template.getTypeUrl());
assertEquals(OutputPrefixType.TINK, template.getOutputPrefixType());
AesGcmKeyFormat format = AesGcmKeyFormat.parseFrom(template.getValue(), ExtensionRegistryLite.getEmptyRegistry());
assertEquals(32, format.getKeySize());
}
use of com.google.crypto.tink.proto.AesGcmKeyFormat in project tink by google.
the class AeadKeyTemplatesTest method aes128Gcm.
@Test
public void aes128Gcm() throws Exception {
KeyTemplate template = AeadKeyTemplates.AES128_GCM;
assertEquals(new AesGcmKeyManager().getKeyType(), template.getTypeUrl());
assertEquals(OutputPrefixType.TINK, template.getOutputPrefixType());
AesGcmKeyFormat format = AesGcmKeyFormat.parseFrom(template.getValue(), ExtensionRegistryLite.getEmptyRegistry());
assertEquals(16, format.getKeySize());
}
use of com.google.crypto.tink.proto.AesGcmKeyFormat in project tink by google.
the class AesGcmKeyManagerTest method testRawAes256GcmTemplate.
@Test
public void testRawAes256GcmTemplate() throws Exception {
KeyTemplate template = AesGcmKeyManager.rawAes256GcmTemplate();
assertEquals(new AesGcmKeyManager().getKeyType(), template.getTypeUrl());
assertEquals(KeyTemplate.OutputPrefixType.RAW, template.getOutputPrefixType());
AesGcmKeyFormat format = AesGcmKeyFormat.parseFrom(ByteString.copyFrom(template.getValue()), ExtensionRegistryLite.getEmptyRegistry());
assertEquals(32, format.getKeySize());
}
use of com.google.crypto.tink.proto.AesGcmKeyFormat in project tink by google.
the class AesGcmKeyManagerTest method testAes256GcmTemplate.
@Test
public void testAes256GcmTemplate() throws Exception {
KeyTemplate template = AesGcmKeyManager.aes256GcmTemplate();
assertEquals(new AesGcmKeyManager().getKeyType(), template.getTypeUrl());
assertEquals(KeyTemplate.OutputPrefixType.TINK, template.getOutputPrefixType());
AesGcmKeyFormat format = AesGcmKeyFormat.parseFrom(ByteString.copyFrom(template.getValue()), ExtensionRegistryLite.getEmptyRegistry());
assertEquals(32, format.getKeySize());
}
Aggregations