cipher

package
v0.0.0-...-5508e09 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package cipher implements crypto algorithms for crypto generic.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Default is global variable with reference to default cipher.
	Default = NewKMS()
)

Functions

This section is empty.

Types

type KMS

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

KMS is the context of AWS KMS cipher

func NewKMS

func NewKMS(api ...kmsiface.KMSAPI) *KMS

NewKMS returns AWS KMS context

func NewNone

func NewNone() *KMS

NewNone creates identity (none) codecs

func (*KMS) Decrypt

func (c *KMS) Decrypt(cryptotext string) (plaintext []byte, err error)

Decrypt uses AWS KMS API to decrypt cryptotext.

func (*KMS) Decrypt64

func (c *KMS) Decrypt64(codec *base64.Encoding, cryptotext string) (plaintext []byte, err error)

Decrypt64 uses AWS KMS API to decrypt cryptotext.

func (*KMS) Encrypt

func (c *KMS) Encrypt(plaintext []byte) (cryptotext string, err error)

Encrypt uses AWS KMS API to encrypt plaintext.

func (*KMS) Encrypt64

func (c *KMS) Encrypt64(codec *base64.Encoding, plaintext []byte) (cryptotext string, err error)

Encrypt64 uses AWS KMS API to encrypt plaintext.

func (*KMS) UseKey

func (c *KMS) UseKey(key string)

UseKey defines encryption key

Jump to

Keyboard shortcuts

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