symmetric

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SkipVerify

func SkipVerify(csum []byte, key *key.RawKey, open *[]byte) bool

func Verify

func Verify(csum []byte, key *key.RawKey, open *[]byte) bool

Types

type Base64SealContainer

type Base64SealContainer struct {
	KeyAndNonce
	Checksum []byte
	Payload  string
}

type JsonKeyAndNonce

type JsonKeyAndNonce struct {
	Key   string
	Nouce string
}

func (*JsonKeyAndNonce) AsKeyAndNonce

func (my *JsonKeyAndNonce) AsKeyAndNonce() (*KeyAndNonce, error)

type KeyAndNonce

type KeyAndNonce struct {
	Key   []byte
	Nouce []byte
}

func (*KeyAndNonce) AsJSON

func (my *KeyAndNonce) AsJSON() *JsonKeyAndNonce

type OpenContainer

type OpenContainer struct {
	Checksum []byte
	Payload  []byte
}

func Open

func Open(key *key.RawKey, sc *SealedContainer, verify func([]byte, *key.RawKey, *[]byte) bool) (*OpenContainer, error)

func OpenBase64

func OpenBase64(key *key.RawKey, pp *Base64SealContainer, verify func([]byte, *key.RawKey, *[]byte) bool) (*OpenContainer, error)

type SealRequest

type SealRequest struct {
	Key      key.RawKey
	Payload  []byte
	Checksum []byte
}

func Checksum

func Checksum(sr *SealRequest) *SealRequest

type SealedContainer

type SealedContainer struct {
	Checksum []byte
	Payload  []byte
}

func Seal

func Seal(sr *SealRequest) (*SealedContainer, error)

Jump to

Keyboard shortcuts

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