keys

package
v0.0.0-...-84f1f66 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key struct {
	Value   []byte    `json:"value" bson:"value"`
	Created time.Time `json:"created" bson:"created"`
}

func NewKey

func NewKey(length int) (*Key, error)

func (*Key) Secure

func (k *Key) Secure(masterKey MasterKey) (*SecuredKey, error)

func (*Key) ValueBase64

func (k *Key) ValueBase64() string

func (*Key) ValueHex

func (k *Key) ValueHex() string

type MasterKey

type MasterKey [32]byte

func MasterKeyFromBytes

func MasterKeyFromBytes(in []byte) (res MasterKey)

type SecuredKey

type SecuredKey struct {
	Name    string    `json:"name" bson:"name"`
	Value   []byte    `json:"value" bson:"value"`
	Hash    []byte    `json:"hash" bson:"hash"`
	Created time.Time `json:"created" bson:"created"`
}

func NewSecureKey

func NewSecureKey(length int, mk MasterKey) (*SecuredKey, error)

func (*SecuredKey) Unsecure

func (k *SecuredKey) Unsecure(masterKey [32]byte) (*Key, error)

Jump to

Keyboard shortcuts

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