func (km *x25519ECDHKWPublicKeyManager) DoesSupport(typeURL string) bool {
	return typeURL == x25519ECDHKWPublicKeyTypeURL
}
DoesSupport indicates if this key manager supports the given key type.
package ecdh
import (
	"errors"
	"fmt"
	"github.com/golang/protobuf/proto"
	"github.com/google/tink/go/core/registry"
	"github.com/google/tink/go/keyset"
	tinkpb "github.com/google/tink/go/proto/tink_go_proto"
	"github.com/hyperledger/aries-framework-go/pkg/crypto/tinkcrypto/primitive/composite"
	"github.com/hyperledger/aries-framework-go/pkg/crypto/tinkcrypto/primitive/composite/ecdh/subtle"
	ecdhpb "github.com/hyperledger/aries-framework-go/pkg/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto"
)
const (
	x25519ECDHKWPublicKeyVersion = 0
	x25519ECDHKWPublicKeyTypeURL = "type.hyperledger.org/hyperledger.aries.crypto.tink.X25519EcdhKwPublicKey"
)
var errInvalidx25519ECDHKWPublicKey = errors.New("x25519kw_ecdh_public_key_manager: invalid key")
type x25519ECDHKWPublicKeyManager struct{}
var _ registry.KeyManager = (*x25519ECDHKWPublicKeyManager)(nil)
func newX25519ECDHKWPublicKeyManager() *x25519ECDHKWPublicKeyManager {
	return new(x25519ECDHKWPublicKeyManager)
}
func (km *x25519ECDHKWPublicKeyManager) Primitive(serializedKey []byte) (interface{}, error) {
	if len(serializedKey) == 0 {
		return nil, errInvalidx25519ECDHKWPublicKey
	}
	ecdhPubKey := new(ecdhpb.EcdhAeadPublicKey)
	err := proto.Unmarshal(serializedKey, ecdhPubKey)
	if err != nil {
		return nil, errInvalidx25519ECDHKWPublicKey
	}
	err = km.validateKey(ecdhPubKey)
	if err != nil {
		return nil, errInvalidx25519ECDHKWPublicKey
	}
	rEnc, err := composite.NewRegisterCompositeAEADEncHelper(ecdhPubKey.Params.EncParams.AeadEnc)
	if err != nil {
		return nil, fmt.Errorf("x25519kw_ecdh_public_key_manager: NewRegisterCompositeAEADEncHelper "+
			"failed: %w", err)
	}
	return subtle.NewECDHAEADCompositeEncrypt(rEnc, ecdhPubKey.Params.EncParams.CEK), nil
}