use of com.google.crypto.tink.proto.RegistryConfig in project tink by google.
the class AeadConfigTest method testConfigContents1_0_0.
@Test
public void testConfigContents1_0_0() throws Exception {
RegistryConfig config = AeadConfig.TINK_1_0_0;
assertEquals(7, config.getEntryCount());
assertEquals("TINK_AEAD_1_0_0", config.getConfigName());
TestUtil.verifyConfigEntry(config.getEntry(0), "TinkMac", "Mac", "type.googleapis.com/google.crypto.tink.HmacKey", true, 0);
TestUtil.verifyConfigEntry(config.getEntry(1), "TinkAead", "Aead", "type.googleapis.com/google.crypto.tink.AesCtrHmacAeadKey", true, 0);
TestUtil.verifyConfigEntry(config.getEntry(2), "TinkAead", "Aead", "type.googleapis.com/google.crypto.tink.AesEaxKey", true, 0);
TestUtil.verifyConfigEntry(config.getEntry(3), "TinkAead", "Aead", "type.googleapis.com/google.crypto.tink.AesGcmKey", true, 0);
TestUtil.verifyConfigEntry(config.getEntry(4), "TinkAead", "Aead", "type.googleapis.com/google.crypto.tink.ChaCha20Poly1305Key", true, 0);
TestUtil.verifyConfigEntry(config.getEntry(5), "TinkAead", "Aead", "type.googleapis.com/google.crypto.tink.KmsAeadKey", true, 0);
TestUtil.verifyConfigEntry(config.getEntry(6), "TinkAead", "Aead", "type.googleapis.com/google.crypto.tink.KmsEnvelopeAeadKey", true, 0);
}
use of com.google.crypto.tink.proto.RegistryConfig in project tink by google.
the class SignatureConfigTest method testConfigContents1_1_0.
@Test
public void testConfigContents1_1_0() throws Exception {
RegistryConfig config = SignatureConfig.TINK_1_1_0;
assertEquals(4, config.getEntryCount());
assertEquals("TINK_SIGNATURE_1_1_0", config.getConfigName());
TestUtil.verifyConfigEntry(config.getEntry(0), "TinkPublicKeySign", "PublicKeySign", "type.googleapis.com/google.crypto.tink.EcdsaPrivateKey", true, 0);
TestUtil.verifyConfigEntry(config.getEntry(1), "TinkPublicKeySign", "PublicKeySign", "type.googleapis.com/google.crypto.tink.Ed25519PrivateKey", true, 0);
TestUtil.verifyConfigEntry(config.getEntry(2), "TinkPublicKeyVerify", "PublicKeyVerify", "type.googleapis.com/google.crypto.tink.EcdsaPublicKey", true, 0);
TestUtil.verifyConfigEntry(config.getEntry(3), "TinkPublicKeyVerify", "PublicKeyVerify", "type.googleapis.com/google.crypto.tink.Ed25519PublicKey", true, 0);
}
use of com.google.crypto.tink.proto.RegistryConfig in project tink by google.
the class SignatureConfigTest method aaaTestInitialization.
// This test must run first.
@Test
public void aaaTestInitialization() throws Exception {
try {
Registry.getCatalogue("tinkpublickeysign");
fail("Expected GeneralSecurityException");
} catch (GeneralSecurityException e) {
assertThat(e.toString()).contains("no catalogue found");
assertThat(e.toString()).contains("SignatureConfig.init()");
}
try {
Registry.getCatalogue("tinkpublickeyverify");
fail("Expected GeneralSecurityException");
} catch (GeneralSecurityException e) {
assertThat(e.toString()).contains("no catalogue found");
assertThat(e.toString()).contains("SignatureConfig.init()");
}
// Get the config proto, now the catalogues should be present,
// as init() was triggered by a static block.
RegistryConfig unused = SignatureConfig.TINK_1_1_0;
Registry.getCatalogue("tinkpublickeysign");
Registry.getCatalogue("tinkpublickeyverify");
// Running init() manually again should succeed.
SignatureConfig.init();
}
use of com.google.crypto.tink.proto.RegistryConfig in project tink by google.
the class SignatureConfigTest method testConfigContents.
@Test
public void testConfigContents() throws Exception {
RegistryConfig config = SignatureConfig.TINK_1_0_0;
assertEquals(4, config.getEntryCount());
assertEquals("TINK_SIGNATURE_1_0_0", config.getConfigName());
TestUtil.verifyConfigEntry(config.getEntry(0), "TinkPublicKeySign", "PublicKeySign", "type.googleapis.com/google.crypto.tink.EcdsaPrivateKey", true, 0);
TestUtil.verifyConfigEntry(config.getEntry(1), "TinkPublicKeySign", "PublicKeySign", "type.googleapis.com/google.crypto.tink.Ed25519PrivateKey", true, 0);
TestUtil.verifyConfigEntry(config.getEntry(2), "TinkPublicKeyVerify", "PublicKeyVerify", "type.googleapis.com/google.crypto.tink.EcdsaPublicKey", true, 0);
TestUtil.verifyConfigEntry(config.getEntry(3), "TinkPublicKeyVerify", "PublicKeyVerify", "type.googleapis.com/google.crypto.tink.Ed25519PublicKey", true, 0);
}
use of com.google.crypto.tink.proto.RegistryConfig in project tink by google.
the class MacConfigTest method testConfigContents1_0_0.
@Test
public void testConfigContents1_0_0() throws Exception {
RegistryConfig config = MacConfig.TINK_1_0_0;
assertEquals(1, config.getEntryCount());
assertEquals("TINK_MAC_1_0_0", config.getConfigName());
TestUtil.verifyConfigEntry(config.getEntry(0), "TinkMac", "Mac", "type.googleapis.com/google.crypto.tink.HmacKey", true, 0);
}
Aggregations