key

package
v0.0.0-...-c3ab6b1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package key provides an interface for creating and using encryption keys.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KMS

type KMS struct {
	ID string
	// contains filtered or unexported fields
}

KMS represents an abstraction of the AWS key management system (KMS).

func NewKMS

func NewKMS(sess session.Session) *KMS

NewKMS returns a pointer to a new KMS struct.

func (KMS) Decrypt

func (key KMS) Decrypt(ciphertext string) string

Decrypt decrypts a string using the AWS KMS service.

func (KMS) Encrypt

func (key KMS) Encrypt(plaintext string) string

Encrypt encrypts a string using the AWS KMS service.

func (KMS) GetClient

func (key KMS) GetClient() kms.KMS

GetClient gets the Session of the KMS struct.

func (KMS) GetID

func (key KMS) GetID() string

GetID gets the ID of the KMS struct.

func (*KMS) SetClient

func (key *KMS) SetClient(newClient kms.KMS)

SetClient gets the Session of the KMS struct.

func (*KMS) SetID

func (key *KMS) SetID(newID string)

SetID sets the ID of the KMS struct.

type Key

type Key interface {
	Encrypt(string) string // Encrypt a string
	Decrypt(string) string // Decrypt a string
	GetID() string         // Return the ID of the key.
	SetID(string)          // Set the ID of the key.
}

Key is an interface that defines the methods required by Key structs

Jump to

Keyboard shortcuts

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