use of com.google.crypto.tink.proto.JwtHmacKeyFormat in project tink by google.
the class JwtHmacKeyManagerTest method testHs256Template.
@Test
public void testHs256Template() throws Exception {
KeyTemplate template = KeyTemplates.get("JWT_HS256");
assertThat(template.getTypeUrl()).isEqualTo(manager.getKeyType());
assertThat(template.getOutputPrefixType()).isEqualTo(KeyTemplate.OutputPrefixType.TINK);
JwtHmacKeyFormat format = JwtHmacKeyFormat.parseFrom(template.getValue(), ExtensionRegistryLite.getEmptyRegistry());
assertThat(format.getKeySize()).isEqualTo(32);
assertThat(format.getAlgorithm()).isEqualTo(JwtHmacAlgorithm.HS256);
}
Aggregations