github.com/trustbloc/kms-go@v1.1.2/crypto/tinkcrypto/primitive/composite/api/composite_decrypt.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  // CompositeDecrypt will decrypt a `ciphertext` representing a composite encryption with a protected cek for the
    10  // recipient caller of this interface. In order to get the plaintext embedded, this type is configured with the
    11  // recipient key type that will decrypt the embedded cek first.
    12  type CompositeDecrypt interface {
    13  	// Decrypt operation: decrypts ciphertext representing a serialized EncryptedData (mainly extracted from a
    14  	// JWE message) for a given recipient. It uses an unwrapped cek and the AEAD decrypt primitive.
    15  	// returns resulting plaintext extracted from the serialized object.
    16  	Decrypt(cipherText, additionalData []byte) ([]byte, error)
    17  }