RegistryEciesAeadHkdfDemHelper implements EciesAeadHkdfDemHelper { @Override public int getSymmetricKeySizeInBytes() { return symmetricKeySize; } RegistryEciesAeadHkdfDemHelper(KeyTemplate demTemplate); @Override int getSymmetricKeySizeInBytes(); @Override Aead getAead(final byte[] symmetricKeyValue);  }
@Test public void testConstructorWith128BitCiphers() throws Exception { RegistryEciesAeadHkdfDemHelper helper; helper = new RegistryEciesAeadHkdfDemHelper(AeadKeyTemplates.AES128_GCM); assertEquals(16, helper.getSymmetricKeySizeInBytes()); helper = new RegistryEciesAeadHkdfDemHelper(AeadKeyTemplates.AES128_CTR_HMAC_SHA256); assertEquals(48, helper.getSymmetricKeySizeInBytes()); }
@Test public void testConstructorWith256BitCiphers() throws Exception { if (Cipher.getMaxAllowedKeyLength("AES") < 256) { System.out.println( "Unlimited Strength Jurisdiction Policy Files are required" + " but not installed. Skip tests with keys larger than 128 bits."); return; } RegistryEciesAeadHkdfDemHelper helper = new RegistryEciesAeadHkdfDemHelper(AeadKeyTemplates.AES256_GCM); assertEquals(32, helper.getSymmetricKeySizeInBytes()); helper = new RegistryEciesAeadHkdfDemHelper(AeadKeyTemplates.AES256_CTR_HMAC_SHA256); assertEquals(64, helper.getSymmetricKeySizeInBytes()); }