Documentation ¶
Index ¶
- Constants
- func GetBCCSPFromConf(dir string, keyStorePath string, conf *config.BCCSP) (bccsp.BCCSP, bccsp.KeyStore, error)
- func GetEnrollmentID(id []byte) (string, error)
- func GetPKCS11BCCSP(conf *config.BCCSP) (bccsp.BCCSP, bccsp.KeyStore, error)
- func GetRevocationHandle(id []byte) ([]byte, error)
- func GetSWBCCSP(dir string) (bccsp.BCCSP, bccsp.KeyStore, error)
- func GetSigningIdentity(mspConfigPath, keyStorePath, mspID string, bccspConfig *config.BCCSP) (driver.SigningIdentity, error)
- func IsLowS(k *ecdsa.PublicKey, s *big.Int) (bool, error)
- func LoadLocalMSPAt(dir, keyStorePath, id, mspType string, bccspConfig *config.BCCSP) (msp.MSP, error)
- func LoadLocalMSPSignerCert(dir string) ([]byte, error)
- func LoadVerifyingMSPAt(dir, id, mspType string) (msp.MSP, error)
- func NewIdentityFromBytes(raw []byte) (view.Identity, driver.Verifier, error)
- func NewSigner() (view.Identity, driver.Signer, driver.Verifier, error)
- func NewVerifier(pk *ecdsa.PublicKey) *edsaVerifier
- func PemDecodeCert(pemBytes []byte) (*x509.Certificate, error)
- func PemDecodeKey(keyBytes []byte) (interface{}, error)
- func PemEncodeKey(key interface{}) ([]byte, error)
- func Serialize(mspID string, certPath string) ([]byte, error)
- func SerializeFromMSP(mspID string, path string) ([]byte, error)
- func SerializeRaw(mspID string, raw []byte) ([]byte, error)
- func ToBCCSPOpts(boxed interface{}) (*config.BCCSP, error)
- func ToLowS(k *ecdsa.PublicKey, s *big.Int) (*big.Int, bool, error)
- func ToPKCS11OptsOpts(o *config.PKCS11) *pkcs11.PKCS11Opts
- type AuditInfo
- type Deserializer
- type FolderIdentityLoader
- type IdentityLoader
- type Provider
- func (p *Provider) DeserializeSigner(raw []byte) (driver.Signer, error)
- func (p *Provider) DeserializeVerifier(raw []byte) (driver.Verifier, error)
- func (p *Provider) EnrollmentID() string
- func (p *Provider) Identity(opts *driver.IdentityOptions) (view.Identity, []byte, error)
- func (p *Provider) Info(raw []byte, auditInfo []byte) (string, error)
- func (p *Provider) IsRemote() bool
- func (p *Provider) SerializedIdentity() (driver2.SigningIdentity, error)
- func (p *Provider) String() string
- type SignerService
Constants ¶
const ( MSPType = "bccsp" BCCSPOptField = "bccsp" // viper converts map keys to lowercase )
const ( BCCSPType = "bccsp" SignCerts = "signcerts" )
Variables ¶
This section is empty.
Functions ¶
func GetBCCSPFromConf ¶
func GetBCCSPFromConf(dir string, keyStorePath 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 GetPKCS11BCCSP ¶
GetPKCS11BCCSP returns a new instance of the HSM-based BCCSP
func GetRevocationHandle ¶ added in v0.3.0
func GetSWBCCSP ¶
GetSWBCCSP returns a new instance of the software-based BCCSP
func GetSigningIdentity ¶
func GetSigningIdentity(mspConfigPath, keyStorePath, mspID string, bccspConfig *config.BCCSP) (driver.SigningIdentity, error)
GetSigningIdentity retrieves a signing identity from the passed arguments. If keyStorePath is empty, then it is assumed that the key is at mspConfigPath/keystore
func LoadLocalMSPAt ¶
func LoadLocalMSPAt(dir, keyStorePath, 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 LoadVerifyingMSPAt ¶
LoadVerifyingMSPAt loads a verifying MSP whose configuration is stored at 'dir', and whose id and type are the passed as arguments.
func NewIdentityFromBytes ¶
func NewVerifier ¶
func PemDecodeCert ¶
func PemDecodeCert(pemBytes []byte) (*x509.Certificate, error)
func PemDecodeKey ¶
PemDecodeKey takes bytes and returns a Go key
func PemEncodeKey ¶
PemEncodeKey takes a Go key and converts it to bytes
func ToBCCSPOpts ¶ added in v0.2.0
func ToPKCS11OptsOpts ¶ added in v0.4.0
func ToPKCS11OptsOpts(o *config.PKCS11) *pkcs11.PKCS11Opts
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
}
type IdentityLoader ¶ added in v0.2.0
type IdentityLoader struct{}
type Provider ¶ added in v0.3.0
type Provider struct {
// contains filtered or unexported fields
}
func NewProvider ¶
func NewProvider(mspConfigPath, keyStorePath, mspID string, signerService SignerService) (*Provider, error)
NewProvider returns a new X509 provider. If the configuration path contains the secret key, then the provider can generate also signatures, otherwise it cannot.
func NewProviderWithBCCSPConfig ¶
func NewProviderWithBCCSPConfig(mspConfigPath, keyStorePath, mspID string, signerService SignerService, bccspConfig *config.BCCSP) (*Provider, error)
NewProviderWithBCCSPConfig returns a new X509 provider with the passed BCCSP configuration. If the configuration path contains the secret key, then the provider can generate also signatures, otherwise it cannot.
func (*Provider) DeserializeSigner ¶ added in v0.3.0
func (*Provider) DeserializeVerifier ¶ added in v0.3.0
func (*Provider) EnrollmentID ¶ added in v0.3.0
func (*Provider) SerializedIdentity ¶ added in v0.3.0
func (p *Provider) SerializedIdentity() (driver2.SigningIdentity, error)