Back to godoc.org

Package crypto

v2.1.1+incompatible
Latest Go to latest
Published: Jun 1, 2020 | License: Apache-2.0 | Module: github.com/hyperledger/fabric

Index

Package Files

Constants

const (
	// NonceSize is the default NonceSize
	NonceSize = 24
)

func ExpiresAt

func ExpiresAt(identityBytes []byte) time.Time

ExpiresAt returns when the given identity expires, or a zero time.Time in case we cannot determine that

func GetRandomBytes

func GetRandomBytes(len int) ([]byte, error)

GetRandomBytes returns len random looking bytes

func GetRandomNonce

func GetRandomNonce() ([]byte, error)

GetRandomNonce returns a random byte array of length NonceSize

func TrackExpiration

func TrackExpiration(tls bool, serverCert []byte, clientCertChain [][]byte, sIDBytes []byte, warn WarnFunc, now time.Time, s Scheduler)

TrackExpiration warns a week before one of the certificates expires

type Scheduler

type Scheduler func(d time.Duration, f func()) *time.Timer

Scheduler invokes f after d time, and can be replaced with time.AfterFunc.

type WarnFunc

type WarnFunc func(format string, args ...interface{})

WarnFunc notifies a warning happened with the given format, and can be replaced with Warnf of a logger.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier