use of com.google.crypto.tink.proto.Keyset.Key in project tink by google.
the class PrimitiveSetTest method testAddPrimive_withUnknownPrefixType_shouldFail.
@Test
public void testAddPrimive_withUnknownPrefixType_shouldFail() throws Exception {
PrimitiveSet<Mac> pset = PrimitiveSet.newPrimitiveSet(Mac.class);
Key key1 = Key.newBuilder().setKeyId(1).setStatus(KeyStatusType.ENABLED).build();
GeneralSecurityException e = assertThrows(GeneralSecurityException.class, () -> pset.addPrimitive(new DummyMac1(), key1));
assertExceptionContains(e, "unknown output prefix type");
}
Aggregations