scrypto

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrCipherFailure common.ErrMsg = "Unable to initialize AES cipher"
	ErrMacFailure    common.ErrMsg = "Unable to initialize Mac"
)
View Source
const (
	ErrInvalidNonceSize      common.ErrMsg = "Invalid nonce size"
	ErrUnableToGenerateNonce common.ErrMsg = "Unable to generate nonce"
)

Variables

This section is empty.

Functions

func EncodePEMSymmetricKey added in v0.7.0

func EncodePEMSymmetricKey(key []byte) ([]byte, error)

EncodePEMSymmetricKey encodes the raw key in a PEM block with the SYMMETRIC KEY type.

func HFMacFactory added in v0.4.0

func HFMacFactory(key []byte) (func() hash.Hash, error)

func InitMac

func InitMac(key []byte) (hash.Hash, error)

func ParsePEMSymmetricKey added in v0.7.0

func ParsePEMSymmetricKey(b []byte) ([]byte, error)

ParsePEMSymmetricKey parses the first PEM block in b and returns the data within.

This provides a more idiomatic way of accessing errors (when compared with the pem.Decode function), and allows us to add more validation in the future (e.g., if we want to make use of PEM headers).

func RandInt64

func RandInt64() int64

RandInt64 returns a random int64 value. The returned value can be negative.

func RandUint64

func RandUint64() uint64

Types

type Version added in v0.4.0

type Version uint64

Version identifies the version of a trust file. It cannot be marshalled/unmarshalled to/from LatestVer.

const LatestVer Version = 0

LatestVer is the wildcard version indicating the highest available version when requesting certificate chains and TRCs.

func (Version) IsLatest added in v0.4.0

func (v Version) IsLatest() bool

IsLatest checks if the value is LatestVer.

func (Version) String added in v0.5.0

func (v Version) String() string

Directories

Path Synopsis
cms
oid
Package oid contains OID definitions.
Package oid contains OID definitions.
protocol
Package protocol implements low level CMS types, parsing and generation.
Package protocol implements low level CMS types, parsing and generation.

Jump to

Keyboard shortcuts

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