github.com/trustbloc/kms-go@v1.1.2/crypto/tinkcrypto/primitive/composite/api/composite_encrypt.go (about) 1 /* 2 Copyright SecureKey Technologies Inc. All Rights Reserved. 3 4 SPDX-License-Identifier: Apache-2.0 5 */ 6 7 package api 8 9 // package api provides the composite primitive interfaces. These will be mainly used as the crypto primitives for 10 // building protected JWE messages. 11 12 // CompositeEncrypt will encrypt a `plaintext` using AEAD primitive (with ECDH-ES cek key wrapping by recipient executed 13 // externally). It returns the resulting serialized JWE []byte. This type is used mainly for repudiation requests where 14 // the sender identity remains unknown to the recipient in a serialized EncryptedData envelope (used mainly to build JWE 15 // messages). 16 type CompositeEncrypt interface { 17 // Encrypt operation: encrypts plaintext with aad for a given cek. 18 // Returns resulting EncryptedData wrapping ciphertext content or error if failed. 19 Encrypt(plainText, aad []byte) ([]byte, error) 20 }