crypto

package
v0.0.0-...-fbe82ab Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//noncosize是默认的noncosize
	NonceSize = 24
)

Variables

This section is empty.

Functions

func ExpiresAt

func ExpiresAt(identityBytes []byte) time.Time

expiresat在给定标识过期或零时间后返回。time 如果我们不能确定

func GetRandomBytes

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

GetRandomBytes返回len随机查找字节

func GetRandomNonce

func GetRandomNonce() ([]byte, error)

getrandomonce返回长度为noncosize的随机字节数组

Types

type IdentitySerializer

type IdentitySerializer interface {
	//序列化将标识转换为字节
	Serialize() ([]byte, error)
}

IdentitySerializer序列化标识

type LocalSigner

type LocalSigner interface {
	SignatureHeaderMaker
	Signer
}

localsigner是一个临时存根接口,将由本地MSP实现。

type SignatureHeaderCreator

type SignatureHeaderCreator struct {
	SignerSupport
}

SignatureHeaderCreator创建签名头

func NewSignatureHeaderCreator

func NewSignatureHeaderCreator(ss SignerSupport) *SignatureHeaderCreator

NewSignatureHeaderCreator创建新的签名头

func (*SignatureHeaderCreator) NewSignatureHeader

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

NewSignatureHeader创建具有正确签名标识和有效nonce的SignatureHeader

type SignatureHeaderMaker

type SignatureHeaderMaker interface {
	//
	NewSignatureHeader() (*cb.SignatureHeader, error)
}

SignatureHeaderMaker创建新的SignatureHeader

type Signer

type Signer interface {
	//在消息上签名并返回摘要上的签名,或者失败时出错
	Sign(message []byte) ([]byte, error)
}

签名者在邮件上签名

type SignerSupport

type SignerSupport interface {
	Signer
	IdentitySerializer
}

SignerSupport实现对LocalSigner所需的支持

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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