Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AWSKMS ¶
type AWSKMS struct {
// contains filtered or unexported fields
}
AWSKMS is the implementation of the KeyManagement interface for AWS KMS
type AWSKMSConfig ¶
type AWSKMSConfig struct {
// Log is the logger to use for this implementation
Log *zap.Logger
// KeyID is the ID of the key to use for encryption and decryption
AccessKey string
// Region is the AWS region to use for the KMS client
Region string
// SecretKey is the secret key to use for the KMS client
SecretKey string
// Endpoint is the endpoint to use for the KMS client
Endpoint *string
// KmsKeyID is the ID of the key to use for encryption and decryption
KmsKeyID string
}
AWSKMSConfig is the configuration for the AWS KMS implementation of the KeyManagement interface
func (*AWSKMSConfig) Validate ¶
func (c *AWSKMSConfig) Validate() error
`func (c *AWSKMSConfig) Validate() error` is a method defined on the `AWSKMSConfig` struct. It validates that all the required fields in the `AWSKMSConfig` struct are present and returns an error if any of them are missing. This method is called when creating a new instance of the `AWSKMS` struct to ensure that the configuration is valid.
type KeyManagement ¶
type KeyManagement interface {
Encrypt(ctx context.Context, input []byte) (keyID, version string, result []byte, _ error)
Decrypt(ctx context.Context, keyID, version string, input []byte) (result []byte, _ error)
}
KeyManagement is the interface that defines the methods for encrypting and decrypting data
func NewAWSKMS ¶
func NewAWSKMS(config AWSKMSConfig) (KeyManagement, error)
NewAWSKMS creates a new AWS KMS implementation of the KeyManagement interface
func NewMockAwsKms ¶
func NewMockAwsKms() (KeyManagement, error)