fabric: github.com/hyperledger/fabric/common/crypto Index | Files | Directories

package crypto

import "github.com/hyperledger/fabric/common/crypto"


Package Files

expiration.go random.go


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

func ExpiresAt Uses

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 Uses

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

GetRandomBytes returns len random looking bytes

func GetRandomNonce Uses

func GetRandomNonce() ([]byte, error)

GetRandomNonce returns a random byte array of length NonceSize

func TrackExpiration Uses

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 Uses

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 Uses

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.



Package crypto imports 7 packages (graph) and is imported by 116 packages. Updated 2020-05-09. Refresh now. Tools for package owners.