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

package crypto

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

Index

Package Files

expiration.go random.go signer.go

Constants

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

type IdentitySerializer Uses

type IdentitySerializer interface {
    // Serialize converts an identity to bytes
    Serialize() ([]byte, error)
}

IdentitySerializer serializes identities

type LocalSigner Uses

type LocalSigner interface {
    SignatureHeaderMaker
    Signer
}

LocalSigner is a temporary stub interface which will be implemented by the local MSP

type SignatureHeaderCreator Uses

type SignatureHeaderCreator struct {
    SignerSupport
}

SignatureHeaderCreator creates signature headers

func NewSignatureHeaderCreator Uses

func NewSignatureHeaderCreator(ss SignerSupport) *SignatureHeaderCreator

NewSignatureHeaderCreator creates new signature headers

func (*SignatureHeaderCreator) NewSignatureHeader Uses

func (bs *SignatureHeaderCreator) NewSignatureHeader() (*cb.SignatureHeader, error)

NewSignatureHeader creates a SignatureHeader with the correct signing identity and a valid nonce

type SignatureHeaderMaker Uses

type SignatureHeaderMaker interface {
    // NewSignatureHeader creates a SignatureHeader with the correct signing identity and a valid nonce
    NewSignatureHeader() (*cb.SignatureHeader, error)
}

SignatureHeaderMaker creates a new SignatureHeader

type Signer Uses

type Signer interface {
    // Sign a message and return the signature over the digest, or error on failure
    Sign(message []byte) ([]byte, error)
}

Signer signs messages

type SignerSupport Uses

type SignerSupport interface {
    Signer
    IdentitySerializer
}

SignerSupport implements the needed support for LocalSigner

Directories

PathSynopsis
tlsgen

Package crypto imports 8 packages (graph) and is imported by 33 packages. Updated 2018-10-14. Refresh now. Tools for package owners.