crypto

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func B64ToByte

func B64ToByte(s string) ([]byte, error)

B64ToBytes converst base64 string to bytes

func ByteToB64

func ByteToB64(key []byte) string

ByteToB64 encodes to bytes to base64 string

Types

type AesGcmCypher

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

AesGcmCypher implements the AES GCM

func NewAesGcmCypher

func NewAesGcmCypher(key string) (*AesGcmCypher, error)

NewAesGcmCypher creates the intance of AesGcmCypher

func (*AesGcmCypher) Decrypt

func (c *AesGcmCypher) Decrypt(ct []byte) ([]byte, error)

Decrypt the data

func (*AesGcmCypher) Encrypt

func (c *AesGcmCypher) Encrypt(pt []byte) ([]byte, error)

Encrypt the data

type Cipher

type Cipher interface {
	Encrypt([]byte) ([]byte, error)
	Decrypt([]byte) ([]byte, error)
}

Cipher provides the interface to encrypt and decrypt the secrets

type CryptoError

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

func (*CryptoError) Error

func (e *CryptoError) Error() string

Jump to

Keyboard shortcuts

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