@Test public void testRawEciesP256HkdfHmacSha256Aes128CtrHmacSha256CompressedTemplate() throws Exception { KeyTemplate template = EciesAeadHkdfPrivateKeyManager .rawEciesP256HkdfHmacSha256Aes128CtrHmacSha256CompressedTemplate(); assertEquals(new EciesAeadHkdfPrivateKeyManager().getKeyType(), template.getTypeUrl()); assertEquals(KeyTemplate.OutputPrefixType.RAW, template.getOutputPrefixType()); EciesAeadHkdfKeyFormat format = EciesAeadHkdfKeyFormat.parseFrom( template.getValue(), ExtensionRegistryLite.getEmptyRegistry()); assertThat(format.hasParams()).isTrue(); assertThat(format.getParams().hasKemParams()).isTrue(); assertThat(format.getParams().hasDemParams()).isTrue(); assertThat(format.getParams().getDemParams().hasAeadDem()).isTrue(); assertThat(format.getParams().getEcPointFormat()).isEqualTo(EcPointFormat.COMPRESSED); EciesHkdfKemParams kemParams = format.getParams().getKemParams(); assertThat(kemParams.getCurveType()).isEqualTo(EllipticCurveType.NIST_P256); assertThat(kemParams.getHkdfHashType()).isEqualTo(HashType.SHA256); assertThat(kemParams.getHkdfSalt()).isEmpty(); assertThat(format.getParams().getDemParams().getAeadDem().toString()) .isEqualTo(AeadKeyTemplates.AES128_CTR_HMAC_SHA256.toString()); }
public static final KeyTemplate rawEciesP256HkdfHmacSha256Aes128CtrHmacSha256CompressedTemplate() { return createKeyTemplate( EllipticCurveType.NIST_P256, HashType.SHA256, EcPointFormat.COMPRESSED, AesCtrHmacAeadKeyManager.aes128CtrHmacSha256Template(), KeyTemplate.OutputPrefixType.RAW, EMPTY_SALT); }
EciesAeadHkdfPrivateKeyManager extends PrivateKeyTypeManager<EciesAeadHkdfPrivateKey, EciesAeadHkdfPublicKey> { public static final KeyTemplate rawEciesP256HkdfHmacSha256Aes128CtrHmacSha256CompressedTemplate() { return createKeyTemplate( EllipticCurveType.NIST_P256, HashType.SHA256, EcPointFormat.COMPRESSED, AesCtrHmacAeadKeyManager.aes128CtrHmacSha256Template(), KeyTemplate.OutputPrefixType.RAW, EMPTY_SALT); } }
EciesAeadHkdfPrivateKeyManager extends PrivateKeyTypeManager<EciesAeadHkdfPrivateKey, EciesAeadHkdfPublicKey> { public static final KeyTemplate rawEciesP256HkdfHmacSha256Aes128CtrHmacSha256CompressedTemplate() { return createKeyTemplate( EllipticCurveType.NIST_P256, HashType.SHA256, EcPointFormat.COMPRESSED, AesCtrHmacAeadKeyManager.aes128CtrHmacSha256Template(), KeyTemplate.OutputPrefixType.RAW, EMPTY_SALT); } EciesAeadHkdfPrivateKeyManager(); }
EciesAeadHkdfPrivateKeyManager extends PrivateKeyTypeManager<EciesAeadHkdfPrivateKey, EciesAeadHkdfPublicKey> { public static final KeyTemplate rawEciesP256HkdfHmacSha256Aes128CtrHmacSha256CompressedTemplate() { return createKeyTemplate( EllipticCurveType.NIST_P256, HashType.SHA256, EcPointFormat.COMPRESSED, AesCtrHmacAeadKeyManager.aes128CtrHmacSha256Template(), KeyTemplate.OutputPrefixType.RAW, EMPTY_SALT); } EciesAeadHkdfPrivateKeyManager(); @Override String getKeyType(); @Override int getVersion(); @Override EciesAeadHkdfPublicKey getPublicKey(EciesAeadHkdfPrivateKey key); @Override KeyMaterialType keyMaterialType(); @Override EciesAeadHkdfPrivateKey parseKey(ByteString byteString); @Override void validateKey(EciesAeadHkdfPrivateKey keyProto); @Override KeyFactory<EciesAeadHkdfKeyFormat, EciesAeadHkdfPrivateKey> keyFactory(); static void registerPair(boolean newKeyAllowed); static final KeyTemplate eciesP256HkdfHmacSha256Aes128GcmTemplate(); static final KeyTemplate rawEciesP256HkdfHmacSha256Aes128GcmCompressedTemplate(); static final KeyTemplate eciesP256HkdfHmacSha256Aes128CtrHmacSha256Template(); static final KeyTemplate rawEciesP256HkdfHmacSha256Aes128CtrHmacSha256CompressedTemplate(); }
EciesAeadHkdfPrivateKeyManager extends PrivateKeyTypeManager<EciesAeadHkdfPrivateKey, EciesAeadHkdfPublicKey> { public static final KeyTemplate rawEciesP256HkdfHmacSha256Aes128CtrHmacSha256CompressedTemplate() { return createKeyTemplate( EllipticCurveType.NIST_P256, HashType.SHA256, EcPointFormat.COMPRESSED, AesCtrHmacAeadKeyManager.aes128CtrHmacSha256Template(), KeyTemplate.OutputPrefixType.RAW, EMPTY_SALT); } EciesAeadHkdfPrivateKeyManager(); @Override String getKeyType(); @Override int getVersion(); @Override EciesAeadHkdfPublicKey getPublicKey(EciesAeadHkdfPrivateKey key); @Override KeyMaterialType keyMaterialType(); @Override EciesAeadHkdfPrivateKey parseKey(ByteString byteString); @Override void validateKey(EciesAeadHkdfPrivateKey keyProto); @Override KeyFactory<EciesAeadHkdfKeyFormat, EciesAeadHkdfPrivateKey> keyFactory(); static void registerPair(boolean newKeyAllowed); static final KeyTemplate eciesP256HkdfHmacSha256Aes128GcmTemplate(); static final KeyTemplate rawEciesP256HkdfHmacSha256Aes128GcmCompressedTemplate(); static final KeyTemplate eciesP256HkdfHmacSha256Aes128CtrHmacSha256Template(); static final KeyTemplate rawEciesP256HkdfHmacSha256Aes128CtrHmacSha256CompressedTemplate();  }