github.com/opentofu/opentofu@v1.7.1/internal/encryption/method/method.go (about)

     1  // Copyright (c) The OpenTofu Authors
     2  // SPDX-License-Identifier: MPL-2.0
     3  // Copyright (c) 2023 HashiCorp, Inc.
     4  // SPDX-License-Identifier: MPL-2.0
     5  
     6  package method
     7  
     8  // Method is a low-level encryption method interface that is responsible for encrypting a binary blob of data. It should
     9  // not try to interpret what kind of data it is encrypting.
    10  type Method interface {
    11  	// Encrypt encrypts the specified data with the set configuration. This method should treat any data passed as
    12  	// opaque and should not try to interpret its contents. The interpretation is the job of the encryption.Encryption
    13  	// interface.
    14  	Encrypt(data []byte) ([]byte, error)
    15  	// Decrypt decrypts the specified data with the set configuration. This method should treat any data passed as
    16  	// opaque and should not try to interpret its contents. The interpretation is the job of the encryption.Encryption
    17  	// interface.
    18  	Decrypt(data []byte) ([]byte, error)
    19  }