use of com.google.crypto.tink.proto.HkdfPrfKeyFormat in project tink by google.
the class HkdfPrfKeyManagerTest method validateKeyFormat_empty_throws.
@Test
public void validateKeyFormat_empty_throws() throws Exception {
HkdfPrfKeyFormat keyFormat = HkdfPrfKeyFormat.getDefaultInstance();
assertThrows(GeneralSecurityException.class, () -> factory.validateKeyFormat(keyFormat));
}
use of com.google.crypto.tink.proto.HkdfPrfKeyFormat in project tink by google.
the class PrfKeyTemplatesTest method hkdfSha256Values.
@Test
public void hkdfSha256Values() throws Exception {
HkdfPrfKeyFormat format = HkdfPrfKeyFormat.parseFrom(PrfKeyTemplates.HKDF_SHA256.getValue(), ExtensionRegistryLite.getEmptyRegistry());
assertThat(format.getKeySize()).isEqualTo(32);
assertThat(format.getParams().getHash()).isEqualTo(HashType.SHA256);
}
Aggregations