github.com/opentofu/opentofu@v1.7.1/internal/encryption/keyprovider/keyprovider.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 keyprovider
     7  
     8  // KeyProvider is the usable key provider. The Provide function is responsible for creating both the decryption and
     9  // encryption key, as well as returning the metadata to be stored.
    10  type KeyProvider interface {
    11  	// Provide provides an encryption and decryption keys. If the process fails, it returns an error.
    12  	//
    13  	// The caller must pass in the same struct obtained from the Build function of the Config, with the decryption
    14  	// metadata read in. If no decryption metadata is present, the caller must pass in the struct unmodified.
    15  	Provide(decryptionMeta KeyMeta) (keysOutput Output, encryptionMeta KeyMeta, err error)
    16  }