Documentation
¶
Index ¶
- Constants
- func CreateKmsSigner(uri string) (signature.Signer, error)
- func CreateKmsVerifier(uri string) (signature.Verifier, error)
- func GetEncryptionKey(secretName string) ([]byte, error)
- func S3CreatePresignedDownload(uri string) (string, error)
- func S3DownloadResource(uri string) ([]byte, error)
- func S3UploadArchive(reader io.ReadSeeker, uri string) error
- type KMSCryptoClient
- type KMSDecrypter
- type KMSEncrypter
- type S3Uri
Constants ¶
const ( PresignValidDuration = 5 * time.Minute S3UriPrefix = "s3://" )
Variables ¶
This section is empty.
Functions ¶
func CreateKmsSigner ¶
CreateKmsSigner creates a signer instance from a KMS ARN
func CreateKmsVerifier ¶ added in v1.5.0
CreateKmsVerifier creates a verifier instance from a KMS ARN
func GetEncryptionKey ¶
GetEncryptionKey loads an encryption key from Secrets Manager. In Secrets Manager it is stored base64-encoded, so it gets decoded and returned as binary byte slice.
func S3CreatePresignedDownload ¶
S3CreatePresignedDownload creates a presigned link to an object and returns it as string.
func S3DownloadResource ¶
S3DownloadResource downloads an object by its key and returns the contents as byte slice.
func S3UploadArchive ¶
func S3UploadArchive(reader io.ReadSeeker, uri string) error
S3UploadArchive uploads the byte slice of the archive to S3.
Types ¶
type KMSCryptoClient ¶ added in v1.5.0
type KMSCryptoClient struct {
KeyID string
// contains filtered or unexported fields
}
KMSCryptoClient is the container for the KMS Key
func (*KMSCryptoClient) CanEncrypt ¶ added in v1.5.0
func (enc *KMSCryptoClient) CanEncrypt() bool
CanEncrypt provides a bool if the key is able to en-/decrypt
func (*KMSCryptoClient) KeySize ¶ added in v1.5.0
func (enc *KMSCryptoClient) KeySize() int
KeySize returns the key length in bytes
type KMSDecrypter ¶ added in v1.5.0
type KMSDecrypter struct {
KMSCryptoClient
}
KMSDecrypter implements the Decrypter interface with KMS
func NewKMSDecrypter ¶ added in v1.5.0
func NewKMSDecrypter(keyID string) (*KMSDecrypter, error)
NewKMSDecrypter generates a new KMSDecrypter instance
func (*KMSDecrypter) DecryptMessage ¶ added in v1.5.0
func (dec *KMSDecrypter) DecryptMessage(message []byte) ([]byte, error)
DecryptMessage decrypts a message using the KMS API
type KMSEncrypter ¶ added in v1.5.0
type KMSEncrypter struct {
KMSCryptoClient
}
KMSEncrypter implements the Encrypter interface with KMS
func NewKMSEncrypter ¶ added in v1.5.0
func NewKMSEncrypter(keyID string) (*KMSEncrypter, error)
NewKMSEncrypter generatea a new KMSEncrypter instance
func (*KMSEncrypter) EncryptMessage ¶ added in v1.5.0
func (enc *KMSEncrypter) EncryptMessage(message []byte) ([]byte, error)
EncryptMessage using the KMS API