x509

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: Apache-2.0 Imports: 30 Imported by: 2

Documentation

Index

Constants

View Source
const (
	MSPType       = "bccsp"
	BCCSPOptField = "BCCSP"
)
View Source
const (
	BCCSPType = "bccsp"
	SignCerts = "signcerts"
)

Variables

This section is empty.

Functions

func GetBCCSPFromConf

func GetBCCSPFromConf(dir string, conf *config.BCCSP) (bccsp.BCCSP, bccsp.KeyStore, error)

GetBCCSPFromConf returns a BCCSP instance and its relative key store from the passed configuration. If no configuration is passed, the default one is used, namely the `SW` provider.

func GetEnrollmentID

func GetEnrollmentID(id []byte) (string, error)

func GetPKCS11BCCSP

func GetPKCS11BCCSP(conf *config.BCCSP) (bccsp.BCCSP, bccsp.KeyStore, error)

GetPKCS11BCCSP returns a new instance of the HSM-based BCCSP

func GetSWBCCSP

func GetSWBCCSP(dir string) (bccsp.BCCSP, bccsp.KeyStore, error)

GetSWBCCSP returns a new instance of the software-based BCCSP

func GetSigningIdentity

func GetSigningIdentity(mspConfigPath, mspID string, bccspConfig *config.BCCSP) (driver.SigningIdentity, error)

GetSigningIdentity retrieves a signing identity from the passed arguments

func IsLowS

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

IsLow checks that s is a low-S

func LoadLocalMSPAt

func LoadLocalMSPAt(dir, id, mspType string, bccspConfig *config.BCCSP) (msp.MSP, error)

LoadLocalMSPAt loads an MSP whose configuration is stored at 'dir', and whose id and type are the passed as arguments.

func LoadLocalMSPSignerCert

func LoadLocalMSPSignerCert(dir string) ([]byte, error)

func LoadVerifyingMSPAt

func LoadVerifyingMSPAt(dir, id, mspType string) (msp.MSP, error)

LoadVerifyingMSPAt loads a verifying MSP whose configuration is stored at 'dir', and whose id and type are the passed as arguments.

func NewIdentityFromBytes

func NewIdentityFromBytes(raw []byte) (view.Identity, driver.Verifier, error)

func NewProvider

func NewProvider(mspConfigPath, mspID string, signerService SignerService) (*provider, error)

func NewProviderWithBCCSPConfig

func NewProviderWithBCCSPConfig(mspConfigPath, mspID string, signerService SignerService, bccspConfig *config.BCCSP) (*provider, error)

func NewSigner

func NewSigner() (view.Identity, driver.Signer, driver.Verifier, error)

func NewVerifier

func NewVerifier(pk *ecdsa.PublicKey) *edsaVerifier

func PemDecodeCert

func PemDecodeCert(pemBytes []byte) (*x509.Certificate, error)

func PemDecodeKey

func PemDecodeKey(keyBytes []byte) (interface{}, error)

PemDecodeKey takes bytes and returns a Go key

func PemEncodeKey

func PemEncodeKey(key interface{}) ([]byte, error)

PemEncodeKey takes a Go key and converts it to bytes

func Serialize

func Serialize(mspID string, certPath string) ([]byte, error)

func SerializeFromMSP

func SerializeFromMSP(mspID string, path string) ([]byte, error)

func SerializeRaw

func SerializeRaw(mspID string, raw []byte) ([]byte, error)

func ToBCCSPOpts added in v0.2.0

func ToBCCSPOpts(boxed interface{}) (*config.BCCSP, error)

func ToLowS

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

Types

type Deserializer

type Deserializer struct{}

func (*Deserializer) DeserializeSigner

func (i *Deserializer) DeserializeSigner(raw []byte) (driver.Signer, error)

func (*Deserializer) DeserializeVerifier

func (i *Deserializer) DeserializeVerifier(raw []byte) (driver.Verifier, error)

func (*Deserializer) Info

func (i *Deserializer) Info(raw []byte, auditInfo []byte) (string, error)

func (*Deserializer) String

func (i *Deserializer) String() string

type FolderIdentityLoader added in v0.2.0

type FolderIdentityLoader struct {
	*IdentityLoader
}

func (*FolderIdentityLoader) Load added in v0.2.0

func (f *FolderIdentityLoader) Load(manager driver.Manager, c config.MSP) error

type IdentityLoader added in v0.2.0

type IdentityLoader struct{}

func (*IdentityLoader) Load added in v0.2.0

func (i *IdentityLoader) Load(manager driver.Manager, c config.MSP) error

type SignerService

type SignerService interface {
	RegisterSigner(identity view.Identity, signer fdriver.Signer, verifier fdriver.Verifier) error
}

Jump to

Keyboard shortcuts

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