aws

package
v1.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PresignValidDuration = 5 * time.Minute
	S3UriPrefix          = "s3://"
)

Variables

This section is empty.

Functions

func CreateKmsSigner

func CreateKmsSigner(uri string) (signature.Signer, error)

CreateKmsSigner creates a signer instance from a KMS ARN

func CreateKmsVerifier added in v1.5.0

func CreateKmsVerifier(uri string) (signature.Verifier, error)

CreateKmsVerifier creates a verifier instance from a KMS ARN

func GetEncryptionKey

func GetEncryptionKey(secretName string) ([]byte, error)

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

func S3CreatePresignedDownload(uri string) (string, error)

S3CreatePresignedDownload creates a presigned link to an object and returns it as string.

func S3DownloadResource

func S3DownloadResource(uri string) ([]byte, error)

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

type S3Uri

type S3Uri struct {
	Bucket *string
	Key    *string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL