Documentation ¶
Overview ¶
tape.go is utils copied from tape project
Index ¶
- Variables
- func CommitterFrom(connect *grpc.ClientConn) orderer.AtomicBroadcastClient
- func CreateProposal(creator []byte, channel, ccname, version string, ...) (proposal *peer.Proposal, txid string, err error)
- func DERToPrivateKey(der []byte) (key interface{}, err error)
- func EndorserFrom(connect *grpc.ClientConn) peer.EndorserClient
- func FindKeyFilesOrPanic(dirname string) []string
- func GetCertificate(f string) (*x509.Certificate, []byte, error)
- func GetChaincodeHeaderExtension(hdr *common.Header) (*peer.ChaincodeHeaderExtension, error)
- func GetPrivateKey(f string) (*ecdsa.PrivateKey, error)
- func GetRandomNonce() []byte
- func IsLowS(k *ecdsa.PublicKey, s *big.Int) (bool, error)
- func PEMtoPrivateKey(raw []byte, pwd []byte) (interface{}, error)
- func Ping(target string, params Params) (connect *grpc.ClientConn, err error)
- func ToAddress(url string) string
- func ToLowS(k *ecdsa.PublicKey, s *big.Int) (*big.Int, bool, error)
- type Committer
- type Crypto
- type CryptoConfig
- type ECDSASignature
- type Endorser
- type Node
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // CurveHalfOrders contains the precomputed curve group orders halved. // It is used to ensure that signature' S value is lower or equal to the // curve group order halved. We accept only low-S signatures. // They are precomputed for efficiency reasons. CurveHalfOrders = map[elliptic.Curve]*big.Int{ elliptic.P224(): new(big.Int).Rsh(elliptic.P224().Params().N, 1), elliptic.P256(): new(big.Int).Rsh(elliptic.P256().Params().N, 1), elliptic.P384(): new(big.Int).Rsh(elliptic.P384().Params().N, 1), elliptic.P521(): new(big.Int).Rsh(elliptic.P521().Params().N, 1), } )
Functions ¶
func CommitterFrom ¶
func CommitterFrom(connect *grpc.ClientConn) orderer.AtomicBroadcastClient
func CreateProposal ¶
func DERToPrivateKey ¶
DERToPrivateKey unmarshals a der to private key
func EndorserFrom ¶
func EndorserFrom(connect *grpc.ClientConn) peer.EndorserClient
func FindKeyFilesOrPanic ¶
func GetCertificate ¶
func GetCertificate(f string) (*x509.Certificate, []byte, error)
func GetChaincodeHeaderExtension ¶ added in v0.0.1
func GetChaincodeHeaderExtension(hdr *common.Header) (*peer.ChaincodeHeaderExtension, error)
func GetPrivateKey ¶
func GetPrivateKey(f string) (*ecdsa.PrivateKey, error)
func GetRandomNonce ¶
func GetRandomNonce() []byte
func PEMtoPrivateKey ¶
PEMtoPrivateKey unmarshals a pem to private key
Types ¶
type Committer ¶
type Committer struct { orderer.AtomicBroadcastClient orderer.AtomicBroadcast_BroadcastClient // not intrinsic context.Context }
type Crypto ¶
type Crypto struct { Creator []byte PrivKey *ecdsa.PrivateKey SignCert *x509.Certificate Digest func([]byte) []byte }
func LoadCryptoFrom ¶
func LoadCryptoFrom(config CryptoConfig) (*Crypto, error)
func (*Crypto) NewSignatureHeader ¶
func (s *Crypto) NewSignatureHeader() (*common.SignatureHeader, error)
func (*Crypto) SetDefaultDigest ¶
func (s *Crypto) SetDefaultDigest()
type CryptoConfig ¶
type ECDSASignature ¶
type Endorser ¶
type Endorser struct { peer.EndorserClient context.Context }
func (*Endorser) ProcessProposal ¶
func (endorser *Endorser) ProcessProposal(in *peer.SignedProposal) (*peer.ProposalResponse, error)
type Node ¶
type Node struct { Addr string `yaml:"addr"` TLSCACert string `yaml:"tls_ca_cert"` TLSCAKey string `yaml:"tls_ca_key"` TLSCARoot string `yaml:"tls_ca_root"` TLSCACertByte []byte TLSCAKeyByte []byte TLSCARootByte []byte SslTargetNameOverride string `json:"ssl-target-name-override"` }
func (Node) AsGRPCClient ¶
func (node Node) AsGRPCClient() (connect *grpc.ClientConn, err error)
Click to show internal directories.
Click to hide internal directories.