test_class.file: java_src/src/test/java/com/google/crypto/tink/hybrid/HybridEncryptFactoryTest.java
test_class.identifier: HybridEncryptFactoryTest
test_case.body: @Test
    public void testBasicEncryption() throws Exception {
      EllipticCurveType curve = EllipticCurveType.NIST_P384;
      HashType hashType = HashType.SHA256;
      EcPointFormat primaryPointFormat = EcPointFormat.UNCOMPRESSED;
      EcPointFormat rawPointFormat = EcPointFormat.COMPRESSED;
      KeyTemplate primaryDemKeyTemplate = AeadKeyTemplates.AES128_CTR_HMAC_SHA256;
  
      KeyTemplate rawDemKeyTemplate = AeadKeyTemplates.AES128_CTR_HMAC_SHA256;
      byte[] primarySalt = "some salt".getBytes("UTF-8");
      byte[] rawSalt = "other salt".getBytes("UTF-8");
  
      EciesAeadHkdfPrivateKey primaryPrivProto =
          TestUtil.generateEciesAeadHkdfPrivKey(
              curve, hashType, primaryPointFormat, primaryDemKeyTemplate, primarySalt);
  
      Key primaryPriv =
          TestUtil.createKey(
              TestUtil.createKeyData(
                  primaryPrivProto,
                  new EciesAeadHkdfPrivateKeyManager().getKeyType(),
                  KeyData.KeyMaterialType.ASYMMETRIC_PRIVATE),
              8,
              KeyStatusType.ENABLED,
              OutputPrefixType.RAW);
      Key primaryPub =
          TestUtil.createKey(
              TestUtil.createKeyData(
                  primaryPrivProto.getPublicKey(),
                  new EciesAeadHkdfPublicKeyManager().getKeyType(),
                  KeyData.KeyMaterialType.ASYMMETRIC_PUBLIC),
              42,
              KeyStatusType.ENABLED,
              OutputPrefixType.RAW);
  
      EciesAeadHkdfPrivateKey rawPrivProto =
          TestUtil.generateEciesAeadHkdfPrivKey(
              curve, hashType, rawPointFormat, rawDemKeyTemplate, rawSalt);
  
      Key rawPriv =
          TestUtil.createKey(
              TestUtil.createKeyData(
                  rawPrivProto,
                  new EciesAeadHkdfPrivateKeyManager().getKeyType(),
                  KeyData.KeyMaterialType.ASYMMETRIC_PRIVATE),
              11,
              KeyStatusType.ENABLED,
              OutputPrefixType.RAW);
      Key rawPub =
          TestUtil.createKey(
              TestUtil.createKeyData(
                  rawPrivProto.getPublicKey(),
                  new EciesAeadHkdfPublicKeyManager().getKeyType(),
                  KeyData.KeyMaterialType.ASYMMETRIC_PUBLIC),
              43,
              KeyStatusType.ENABLED,
              OutputPrefixType.RAW);
      KeysetHandle keysetHandlePub =
          TestUtil.createKeysetHandle(TestUtil.createKeyset(primaryPub, rawPub));
      KeysetHandle keysetHandlePriv =
          TestUtil.createKeysetHandle(TestUtil.createKeyset(primaryPriv, rawPriv));
      HybridEncrypt hybridEncrypt = HybridEncryptFactory.getPrimitive(keysetHandlePub);
      HybridDecrypt hybridDecrypt = HybridDecryptFactory.getPrimitive(keysetHandlePriv);
      byte[] plaintext = Random.randBytes(20);
      byte[] contextInfo = Random.randBytes(20);
      byte[] ciphertext = hybridEncrypt.encrypt(plaintext, contextInfo);
      assertArrayEquals(plaintext, hybridDecrypt.decrypt(ciphertext, contextInfo));
    }
test_case.class_method_signature: HybridEncryptFactoryTest.testBasicEncryption()
test_case.full_signature: @Test public void testBasicEncryption()
test_case.identifier: testBasicEncryption
test_case.invocations: getBytes getBytes generateEciesAeadHkdfPrivKey createKey createKeyData getKeyType createKey createKeyData getPublicKey getKeyType generateEciesAeadHkdfPrivKey createKey createKeyData getKeyType createKey createKeyData getPublicKey getKeyType createKeysetHandle createKeyset createKeysetHandle createKeyset getPrimitive getPrimitive randBytes randBytes encrypt assertArrayEquals decrypt
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testBasicEncryption()
focal_class.file: java_src/src/main/java/com/google/crypto/tink/hybrid/HybridEncryptFactory.java
focal_class.identifier: HybridEncryptFactory
focal_class.class_method_signature: HybridEncryptFactory.getPrimitive(KeysetHandle keysetHandle)
focal_class.full_signature: @Deprecated public static HybridEncrypt getPrimitive(KeysetHandle keysetHandle)
focal_class.identifier: getPrimitive
focal_class.modifiers: @Deprecated public static
focal_class.parameters: (KeysetHandle keysetHandle)
focal_class.return: HybridEncrypt
focal_class.signature: HybridEncrypt getPrimitive(KeysetHandle keysetHandle)
focal_class.class_method_signature: HybridEncryptFactory.getPrimitive(
        KeysetHandle keysetHandle, final KeyManager<HybridEncrypt> keyManager)
focal_class.full_signature: @Deprecated public static HybridEncrypt getPrimitive(
        KeysetHandle keysetHandle, final KeyManager<HybridEncrypt> keyManager)
focal_class.identifier: getPrimitive
focal_class.modifiers: @Deprecated public static
focal_class.parameters: (
        KeysetHandle keysetHandle, final KeyManager<HybridEncrypt> keyManager)
focal_class.return: HybridEncrypt
focal_class.signature: HybridEncrypt getPrimitive(
        KeysetHandle keysetHandle, final KeyManager<HybridEncrypt> keyManager)
focal_method.body: @Deprecated
    public static HybridEncrypt getPrimitive(KeysetHandle keysetHandle)
        throws GeneralSecurityException {
      return getPrimitive(keysetHandle, /* keyManager= */ null);
    }
focal_method.class_method_signature: HybridEncryptFactory.getPrimitive(KeysetHandle keysetHandle)
focal_method.full_signature: @Deprecated public static HybridEncrypt getPrimitive(KeysetHandle keysetHandle)
focal_method.identifier: getPrimitive
focal_method.invocations: getPrimitive
focal_method.modifiers: @Deprecated public static
focal_method.parameters: (KeysetHandle keysetHandle)
focal_method.return: HybridEncrypt
focal_method.signature: HybridEncrypt getPrimitive(KeysetHandle keysetHandle)