use of com.google.crypto.tink.proto.KmsAeadKeyFormat in project tink by google.
the class AeadKeyTemplatesTest method testCreateKmsAeadKeyTemplate.
@Test
public void testCreateKmsAeadKeyTemplate() throws Exception {
// Intentionally using "weird" or invalid values for parameters,
// to test that the function correctly puts them in the resulting template.
String keyUri = "some example URI";
KeyTemplate template = AeadKeyTemplates.createKmsAeadKeyTemplate(keyUri);
assertEquals(KmsAeadKeyManager.TYPE_URL, template.getTypeUrl());
assertEquals(OutputPrefixType.TINK, template.getOutputPrefixType());
KmsAeadKeyFormat format = KmsAeadKeyFormat.parseFrom(template.getValue());
assertEquals(keyUri, format.getKeyUri());
}
Aggregations