fabric: github.com/hyperledger/fabric/bccsp/utils Index | Files

package utils

import "github.com/hyperledger/fabric/bccsp/utils"

Index

Package Files

ecdsa.go errs.go io.go keys.go slice.go x509.go

func AEStoEncryptedPEM Uses

func AEStoEncryptedPEM(raw []byte, pwd []byte) ([]byte, error)

AEStoEncryptedPEM encapsulates an AES key in the encrypted PEM format

func AEStoPEM Uses

func AEStoPEM(raw []byte) []byte

AEStoPEM encapsulates an AES key in the PEM format

func Clone Uses

func Clone(src []byte) []byte

Clone clones the passed slice

func DERToPrivateKey Uses

func DERToPrivateKey(der []byte) (key interface{}, err error)

DERToPrivateKey unmarshals a der to private key

func DERToPublicKey Uses

func DERToPublicKey(raw []byte) (pub interface{}, err error)

DERToPublicKey unmarshals a der to public key

func DERToX509Certificate Uses

func DERToX509Certificate(asn1Data []byte) (*x509.Certificate, error)

DERToX509Certificate converts der to x509

func DirEmpty Uses

func DirEmpty(path string) (bool, error)

DirEmpty checks if a directory is empty

func DirExists Uses

func DirExists(path string) (bool, error)

DirExists checks if a directory exists

func DirMissingOrEmpty Uses

func DirMissingOrEmpty(path string) (bool, error)

DirMissingOrEmpty checks is a directory is missing or empty

func ErrToString Uses

func ErrToString(err error) string

ErrToString converts and error to a string. If the error is nil, it returns the string "<clean>"

func GetCurveHalfOrdersAt Uses

func GetCurveHalfOrdersAt(c elliptic.Curve) *big.Int

func IsLowS Uses

func IsLowS(k *ecdsa.PublicKey, s *big.Int) (bool, error)

IsLow checks that s is a low-S

func MarshalECDSASignature Uses

func MarshalECDSASignature(r, s *big.Int) ([]byte, error)

func PEMtoAES Uses

func PEMtoAES(raw []byte, pwd []byte) ([]byte, error)

PEMtoAES extracts from the PEM an AES key

func PEMtoPrivateKey Uses

func PEMtoPrivateKey(raw []byte, pwd []byte) (interface{}, error)

PEMtoPrivateKey unmarshals a pem to private key

func PEMtoPublicKey Uses

func PEMtoPublicKey(raw []byte, pwd []byte) (interface{}, error)

PEMtoPublicKey unmarshals a pem to public key

func PrivateKeyToDER Uses

func PrivateKeyToDER(privateKey *ecdsa.PrivateKey) ([]byte, error)

PrivateKeyToDER marshals a private key to der

func PrivateKeyToEncryptedPEM Uses

func PrivateKeyToEncryptedPEM(privateKey interface{}, pwd []byte) ([]byte, error)

PrivateKeyToEncryptedPEM converts a private key to an encrypted PEM

func PrivateKeyToPEM Uses

func PrivateKeyToPEM(privateKey interface{}, pwd []byte) ([]byte, error)

PrivateKeyToPEM converts the private key to PEM format. EC private keys are converted to PKCS#8 format. RSA private keys are converted to PKCS#1 format.

func PublicKeyToDER Uses

func PublicKeyToDER(publicKey interface{}) ([]byte, error)

PublicKeyToDER marshals a public key to the der format

func PublicKeyToEncryptedPEM Uses

func PublicKeyToEncryptedPEM(publicKey interface{}, pwd []byte) ([]byte, error)

PublicKeyToEncryptedPEM converts a public key to encrypted pem

func PublicKeyToPEM Uses

func PublicKeyToPEM(publicKey interface{}, pwd []byte) ([]byte, error)

PublicKeyToPEM marshals a public key to the pem format

func SignatureToLowS Uses

func SignatureToLowS(k *ecdsa.PublicKey, signature []byte) ([]byte, error)

func ToLowS Uses

func ToLowS(k *ecdsa.PublicKey, s *big.Int) (*big.Int, bool, error)

func UnmarshalECDSASignature Uses

func UnmarshalECDSASignature(raw []byte) (*big.Int, *big.Int, error)

type ECDSASignature Uses

type ECDSASignature struct {
    R, S *big.Int
}

Package utils imports 12 packages (graph) and is imported by 31 packages. Updated 2018-12-12. Refresh now. Tools for package owners.