sealed

package
v4.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidHeader        = errors.New("invalid sealed data header")
	ErrInvalidKeys          = errors.New("invalid decryption keys")
	ErrInvalidAlgorithm     = errors.New("invalid decryption algorithm")
	ErrInvalidEventResponse = errors.New("invalid event response")
)

Functions

func Unseal

func Unseal(sealed []byte, keys []DecryptionKey) ([]byte, error)

func UnsealEventsResponse

func UnsealEventsResponse(sealed []byte, keys []DecryptionKey) (*sdk.EventResponse, error)

UnsealEventsResponse decrypts the sealed response with the provided keys. The SDK will try to decrypt the result with each key until it succeeds. In case if all keys fail, AggregatedUnsealError is returned with error details for each key. To learn more about sealed results visit: https://dev.fingerprint.com/docs/sealed-client-results

Types

type AggregatedUnsealError

type AggregatedUnsealError struct {
	UnsealErrors []UnsealError
}

func NewAggregatedUnsealError

func NewAggregatedUnsealError() *AggregatedUnsealError

func (*AggregatedUnsealError) Add

func (e *AggregatedUnsealError) Add(error UnsealError)

func (*AggregatedUnsealError) Error

func (e *AggregatedUnsealError) Error() string

type Algorithm

type Algorithm string
const (
	AlgorithmAES256GCM Algorithm = "aes-256-gcm"
)

type DecryptionKey

type DecryptionKey struct {
	Key       []byte
	Algorithm Algorithm
}

type UnsealError

type UnsealError struct {
	Error error
	Key   DecryptionKey
}

func NewUnsealError

func NewUnsealError(err error, key DecryptionKey) UnsealError

Jump to

Keyboard shortcuts

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