Documentation ¶
Index ¶
- Constants
- Variables
- func AdminCertsPath(mspPath string) string
- func Certificate(certRaw []byte) (*x509.Certificate, error)
- func CertificatesFromPath(certDir string) ([]*x509.Certificate, error)
- func FabricMSPConfigFromPath(mspID, mspDir string) (*mspproto.FabricMSPConfig, error)
- func Key(keyRaw []byte) (interface{}, error)
- func KeyForCert(certRaw []byte, keyDir string) (interface{}, error)
- func KeyPairForCert(certRaw []byte, keyDir string) (*x509.Certificate, interface{}, error)
- func KeystorePath(mspPath string) string
- func PEMEncode(certRaw []byte) []byte
- func SerializedCertName(path string, pos int) string
- func SignCertsPath(mspPath string) string
- type Identity
- func (i *Identity) Anonymous() bool
- func (i *Identity) ExpiresAt() time.Time
- func (i *Identity) GetCert() *x509.Certificate
- func (i *Identity) GetIdentifier() *msp.IdentityIdentifier
- func (i *Identity) GetMSPIdentifier() string
- func (i *Identity) GetOrganizationalUnits() []*msp.OUIdentifier
- func (i *Identity) GetPEM() []byte
- func (i *Identity) SatisfiesPrincipal(principal *mspPb.MSPPrincipal) error
- func (i *Identity) Serialize() ([]byte, error)
- func (i *Identity) SigningIdentity(privateKey interface{}) *SigningIdentity
- func (i *Identity) Validate() error
- func (i *Identity) Verify(msg []byte, sig []byte) error
- type MSP
- type MSPFiles
- type MSPOpt
- type MSPOpts
- type SigningIdentity
- func FirstSigningFromPath(mspID string, certDir, keyDir string) (*SigningIdentity, error)
- func ListSigningFromPath(mspID string, certDir, keyDir string) ([]*SigningIdentity, error)
- func NewSigning(mspId string, cert *x509.Certificate, privateKey interface{}) *SigningIdentity
- func NewSigningFromBytes(mspId string, certRaw []byte, keyRaw []byte) (*SigningIdentity, error)
- func NewSigningFromFile(mspId string, certPath string, keyPath string) (*SigningIdentity, error)
- func NewSigningFromMSPPath(mspId string, mspPath string) (*SigningIdentity, error)
Constants ¶
View Source
const ( MSPAdminCertsPath = `admincerts` MSPCaCertsPath = `cacerts` MSPIntermediateCertsPath = `intermediatecerts` MSPTLSCaCertsPath = `tlscacerts` MSPTLSIntermediateCertsPath = `tlsintermediatecerts` MSPKeystorePath = "keystore" MSPSignCertsPath = "signcerts" MSPUsersCertsPath = "user" MSPOuCertsPath = "ou" MspConfigFile = "config.yaml" )
Variables ¶
View Source
var ( ErrNoPEMContent = errors.New("no pem content") ErrKeyNotFound = errors.New("key not found") )
View Source
var (
ErrNoFilesInDirectory = errors.New(`no files in directory`)
)
View Source
var (
ErrPEMEncodingFailed = errors.New("pem encoding failed")
)
Functions ¶
func AdminCertsPath ¶ added in v0.7.3
func Certificate ¶ added in v0.7.3
func Certificate(certRaw []byte) (*x509.Certificate, error)
func CertificatesFromPath ¶ added in v0.7.3
func CertificatesFromPath(certDir string) ([]*x509.Certificate, error)
func FabricMSPConfigFromPath ¶ added in v0.7.3
func FabricMSPConfigFromPath(mspID, mspDir string) (*mspproto.FabricMSPConfig, error)
func KeyForCert ¶ added in v0.7.3
KeyForCert returns private key for certificate from keyDir
func KeyPairForCert ¶ added in v0.7.3
func KeyPairForCert(certRaw []byte, keyDir string) (*x509.Certificate, interface{}, error)
func KeystorePath ¶ added in v0.7.3
func SerializedCertName ¶ added in v0.7.3
func SignCertsPath ¶ added in v0.7.3
Types ¶
type Identity ¶ added in v0.10.0
type Identity struct {
// contains filtered or unexported fields
}
func (*Identity) GetCert ¶ added in v0.10.0
func (i *Identity) GetCert() *x509.Certificate
func (*Identity) GetIdentifier ¶ added in v0.10.0
func (i *Identity) GetIdentifier() *msp.IdentityIdentifier
func (*Identity) GetMSPIdentifier ¶ added in v0.10.0
func (*Identity) GetOrganizationalUnits ¶ added in v0.10.0
func (i *Identity) GetOrganizationalUnits() []*msp.OUIdentifier
func (*Identity) SatisfiesPrincipal ¶ added in v0.10.0
func (i *Identity) SatisfiesPrincipal(principal *mspPb.MSPPrincipal) error
func (*Identity) SigningIdentity ¶ added in v0.10.0
func (i *Identity) SigningIdentity(privateKey interface{}) *SigningIdentity
type MSP ¶ added in v0.7.3
type MSP struct {
// contains filtered or unexported fields
}
func MSPFromConfig ¶ added in v0.7.3
func MSPFromConfig(fabricMspConfig *mspproto.FabricMSPConfig) (*MSP, error)
MSPFromConfig created msp config from msp.FabricMSPConfig
func MSPFromPath ¶ added in v0.7.3
MSPFromPath loads msp config from filesystem
func (*MSP) AdminOrSigner ¶ added in v0.7.3
func (m *MSP) AdminOrSigner() *SigningIdentity
AdminOrSigner - returns admin identity if exists, in another case return msp. installation, fetching cc list should happen from admin identity if there is admin identity, use it. in another case - try with msp identity
func (*MSP) Admins ¶ added in v0.7.3
func (m *MSP) Admins() []*SigningIdentity
func (*MSP) Config ¶ added in v0.10.0
func (m *MSP) Config() *mspproto.FabricMSPConfig
func (*MSP) Identifier ¶ added in v0.10.0
func (*MSP) Signer ¶ added in v0.7.3
func (m *MSP) Signer() *SigningIdentity
func (*MSP) Users ¶ added in v0.7.3
func (m *MSP) Users() []*SigningIdentity
type MSPFiles ¶ added in v0.7.3
func SerializeMSP ¶ added in v0.7.3
func SerializeMSP(fabricMSPConfig *mspproto.FabricMSPConfig) (MSPFiles, error)
func (MSPFiles) MergeToPath ¶ added in v0.7.3
type MSPOpt ¶ added in v0.7.3
type MSPOpt func(opts *MSPOpts)
func WithAdminMSPPath ¶ added in v0.7.3
func WithSignCert ¶ added in v0.8.0
func WithSignCertPath ¶ added in v0.8.0
func WithSignKey ¶ added in v0.8.0
func WithSignKeyPath ¶ added in v0.8.0
func WithSkipConfig ¶ added in v0.8.0
func WithSkipConfig() MSPOpt
type SigningIdentity ¶ added in v0.10.0
type SigningIdentity struct { *Identity // contains filtered or unexported fields }
func FirstSigningFromPath ¶ added in v0.10.0
func FirstSigningFromPath(mspID string, certDir, keyDir string) (*SigningIdentity, error)
func ListSigningFromPath ¶ added in v0.10.0
func ListSigningFromPath(mspID string, certDir, keyDir string) ([]*SigningIdentity, error)
func NewSigning ¶ added in v0.10.0
func NewSigning(mspId string, cert *x509.Certificate, privateKey interface{}) *SigningIdentity
func NewSigningFromBytes ¶ added in v0.10.0
func NewSigningFromBytes(mspId string, certRaw []byte, keyRaw []byte) (*SigningIdentity, error)
func NewSigningFromFile ¶ added in v0.10.0
func NewSigningFromFile(mspId string, certPath string, keyPath string) (*SigningIdentity, error)
func NewSigningFromMSPPath ¶ added in v0.10.0
func NewSigningFromMSPPath(mspId string, mspPath string) (*SigningIdentity, error)
func (*SigningIdentity) GetPublicVersion ¶ added in v0.10.0
func (s *SigningIdentity) GetPublicVersion() msp.Identity
Click to show internal directories.
Click to hide internal directories.