github.com/hyperledger/aries-framework-go@v0.3.2/pkg/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_decrypt_factory.go (about)

     1  /*
     2  Copyright SecureKey Technologies Inc. All Rights Reserved.
     3  
     4  SPDX-License-Identifier: Apache-2.0
     5  */
     6  
     7  package ecdh
     8  
     9  import (
    10  	"github.com/google/tink/go/core/registry"
    11  	"github.com/google/tink/go/keyset"
    12  
    13  	"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/api"
    14  	"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh"
    15  )
    16  
    17  // NewECDHDecrypt returns an CompositeDecrypt primitive from the given keyset handle.
    18  func NewECDHDecrypt(h *keyset.Handle) (api.CompositeDecrypt, error) {
    19  	return ecdh.NewECDHDecrypt(h)
    20  }
    21  
    22  // NewECDHDecryptWithKeyManager returns an CompositeDecrypt primitive from the given keyset handle and custom key
    23  // manager.
    24  func NewECDHDecryptWithKeyManager(h *keyset.Handle, km registry.KeyManager) (api.CompositeDecrypt, error) {
    25  	return ecdh.NewECDHDecryptWithKeyManager(h, km)
    26  }