transit

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 3, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchRequestItem

type BatchRequestItem struct {
	// Context for key derivation. This is required for derived keys.
	Context string `json:"context" structs:"context" mapstructure:"context"`

	// DecodedContext is the base64 decoded version of Context
	DecodedContext []byte

	// Plaintext for encryption
	Plaintext string `json:"plaintext" structs:"plaintext" mapstructure:"plaintext"`

	// Ciphertext for decryption
	Ciphertext string `json:"ciphertext" structs:"ciphertext" mapstructure:"ciphertext"`

	// Nonce to be used when v1 convergent encryption is used
	Nonce string `json:"nonce" structs:"nonce" mapstructure:"nonce"`

	// The key version to be used for encryption
	KeyVersion int `json:"key_version" structs:"key_version" mapstructure:"key_version"`

	// DecodedNonce is the base64 decoded version of Nonce
	DecodedNonce []byte
}

BatchRequestItem represents a request item for batch processing

type DecryptBatchResponseItem

type DecryptBatchResponseItem struct {
	// Plaintext for the ciphertext present in the corresponding batch
	// request item
	Plaintext string `json:"plaintext" structs:"plaintext" mapstructure:"plaintext"`
}

type EncryptBatchResponseItem

type EncryptBatchResponseItem struct {
	// Ciphertext for the plaintext present in the corresponding batch
	// request item
	Ciphertext string `json:"ciphertext,omitempty" structs:"ciphertext" mapstructure:"ciphertext"`

	// KeyVersion defines the key version used to encrypt plaintext.
	KeyVersion int `json:"key_version,omitempty" structs:"key_version" mapstructure:"key_version"`
}

EncryptBatchResponseItem represents a response item for batch processing

type Transit

type Transit struct {
	// contains filtered or unexported fields
}

func New

func New(u *unseal.Unseal) Transit

func (Transit) CheckEngine

func (t Transit) CheckEngine(engineName string) bool

func (Transit) CreateKey

func (t Transit) CreateKey(ctx context.Context, name, keyType, engineName string) error

func (Transit) Decrypt

func (t Transit) Decrypt(ctx context.Context, key, engineName string, req BatchRequestItem) (DecryptBatchResponseItem, error)

func (Transit) DeleteKey

func (t Transit) DeleteKey(ctx context.Context, name, engineName string) error

func (Transit) Encrypt

func (t Transit) Encrypt(ctx context.Context, key, engineName string, req BatchRequestItem) (EncryptBatchResponseItem, error)

func (Transit) GetKey

func (t Transit) GetKey(ctx context.Context, name, engineName string) (*keysutil.Policy, error)

func (Transit) HMAC

func (t Transit) HMAC(ctx context.Context, keyName, inputB64, algo string, keyVersion int, engineName string) (string, error)

func (Transit) Hash

func (t Transit) Hash(ctx context.Context, inputB64 string, algo structs.HashType, format string) (string, error)

func (Transit) ListKeys

func (t Transit) ListKeys(ctx context.Context, engineName string) ([]string, error)

func (*Transit) Sign

func (*Transit) VerifySign

Jump to

Keyboard shortcuts

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