use of com.google.crypto.tink.proto.testing.KeysetTemplateRequest in project tink by google.
the class TestingServicesTest method template_success.
@Test
public void template_success() throws Exception {
KeysetTemplateRequest request = KeysetTemplateRequest.newBuilder().setTemplateName("AES256_GCM").build();
KeysetTemplateResponse response = keysetStub.getTemplate(request);
assertThat(response.getErr()).isEmpty();
KeyTemplate template = KeyTemplateProtoConverter.fromByteArray(response.getKeyTemplate().toByteArray());
assertThat(template.getTypeUrl()).isEqualTo("type.googleapis.com/google.crypto.tink.AesGcmKey");
}
use of com.google.crypto.tink.proto.testing.KeysetTemplateRequest in project tink by google.
the class TestingServicesTest method template_not_found.
@Test
public void template_not_found() throws Exception {
KeysetTemplateRequest request = KeysetTemplateRequest.newBuilder().setTemplateName("UNKNOWN_TEMPLATE").build();
KeysetTemplateResponse response = keysetStub.getTemplate(request);
assertThat(response.getErr()).isNotEmpty();
}
Aggregations