awskms

package
v0.0.0-...-86c6960 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CrypterFromKeyID

func CrypterFromKeyID(CseKmsID string, CseKmsRegion string) crypto.Crypter

CrypterFromKeyID creates AWS KMS Crypter with given KMS Key ID

Types

type Crypter

type Crypter struct {
	SymmetricKey crypto.SymmetricKey
}

Crypter is AWS KMS Crypter implementation

func (*Crypter) Decrypt

func (crypter *Crypter) Decrypt(reader io.Reader) (io.Reader, error)

Decrypt creates decrypted reader from ordinary reader

func (*Crypter) Encrypt

func (crypter *Crypter) Encrypt(writer io.Writer) (io.WriteCloser, error)

Encrypt creates encryption writer from ordinary writer

func (*Crypter) Name

func (crypter *Crypter) Name() string

type SymmetricKey

type SymmetricKey struct {
	SymmetricKey             []byte
	SymmetricKeyLen          int
	EncryptedSymmetricKey    []byte
	EncryptedSymmetricKeyLen int

	KeyID  string
	Region string
	// contains filtered or unexported fields
}

SymmetricKey is AWS KMS implementation of crypto.SymmetricKey interface

func NewSymmetricKey

func NewSymmetricKey(kmsKeyID string, keyLen int, encryptedKeyLen int, kmsRegion string) *SymmetricKey

NewSymmetricKey creates new symmetric AWS KMS key object

func (*SymmetricKey) Decrypt

func (symmetricKey *SymmetricKey) Decrypt() error

Decrypt symmetric key with AWS KMS

func (*SymmetricKey) Encrypt

func (symmetricKey *SymmetricKey) Encrypt() error

Encrypt symmetric key with AWS KMS

func (*SymmetricKey) Generate

func (symmetricKey *SymmetricKey) Generate() error

Generate symmetric key

func (*SymmetricKey) GetEncryptedKey

func (symmetricKey *SymmetricKey) GetEncryptedKey() []byte

GetEncryptedKey returns encrypted symmetric key

func (*SymmetricKey) GetEncryptedKeyLen

func (symmetricKey *SymmetricKey) GetEncryptedKeyLen() int

GetEncryptedKeyLen returns encrypted key length

func (*SymmetricKey) GetKey

func (symmetricKey *SymmetricKey) GetKey() []byte

GetKey returna unencrypted symmetric key

func (*SymmetricKey) GetKeyID

func (symmetricKey *SymmetricKey) GetKeyID() string

GetKeyID returns AWS KMS key ID

func (*SymmetricKey) GetKeyLen

func (symmetricKey *SymmetricKey) GetKeyLen() int

GetKeyLen returns key length

func (*SymmetricKey) SetEncryptedKey

func (symmetricKey *SymmetricKey) SetEncryptedKey(encryptedKey []byte) error

SetEncryptedKey set encrypted symmetric key

func (*SymmetricKey) SetKey

func (symmetricKey *SymmetricKey) SetKey(key []byte) error

SetKey set unencrypted symmetric key

Jump to

Keyboard shortcuts

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