github.com/hyperledger/aries-framework-go@v0.3.2/pkg/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_encrypt_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 // NewECDHEncrypt returns an CompositeEncrypt primitive from the given keyset handle. 18 func NewECDHEncrypt(h *keyset.Handle) (api.CompositeEncrypt, error) { 19 return ecdh.NewECDHEncrypt(h) 20 } 21 22 // NewECDHEncryptWithKeyManager returns an CompositeEncrypt primitive from the given h keyset handle and 23 // custom km key manager. 24 func NewECDHEncryptWithKeyManager(h *keyset.Handle, km registry.KeyManager) (api.CompositeEncrypt, error) { 25 return ecdh.NewECDHEncryptWithKeyManager(h, km) 26 }