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 FirstFromPath(mspID string, certDir, keyDir string) (*identity, error)
- func FromBytes(mspId string, certRaw []byte, keyRaw []byte) (*identity, error)
- func FromBytesWithoutSigning(mspId string, certRaw []byte) (*identity, error)
- func FromCertKeyPath(mspId string, certPath string, keyPath string) (api.Identity, 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 ListFromPath(mspID string, certDir, keyDir string) ([]api.Identity, error)
- func New(mspId string, cert *x509.Certificate, privateKey interface{}) *identity
- func PEMEncode(certRaw []byte) []byte
- func SerializedCertName(path string, pos int) string
- func SignCertsPath(mspPath string) string
- func SignerFromMSPPath(mspId string, mspPath string) (*identity, error)
- type MSP
- type MSPConfig
- func (m *MSPConfig) AdminOrSigner() api.Identity
- func (m *MSPConfig) Admins() []api.Identity
- func (m *MSPConfig) GetMSPIdentifier() string
- func (m *MSPConfig) MSPConfig() *mspproto.FabricMSPConfig
- func (m *MSPConfig) Serialize() (MSPFiles, error)
- func (m *MSPConfig) Signer() api.Identity
- func (m *MSPConfig) Users() []api.Identity
- type MSPFiles
- type MSPOpt
- type MSPOpts
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`)
)
Functions ¶
func AdminCertsPath ¶
func Certificate ¶
func Certificate(certRaw []byte) (*x509.Certificate, error)
func CertificatesFromPath ¶
func CertificatesFromPath(certDir string) ([]*x509.Certificate, error)
func FabricMSPConfigFromPath ¶
func FabricMSPConfigFromPath(mspID, mspDir string) (*mspproto.FabricMSPConfig, error)
func FirstFromPath ¶
func FromBytesWithoutSigning ¶
func FromCertKeyPath ¶
func KeyForCert ¶
KeyForCert returns private key for certificate from keyDir
func KeyPairForCert ¶
func KeyPairForCert(certRaw []byte, keyDir string) (*x509.Certificate, interface{}, error)
func KeystorePath ¶
func New ¶
func New(mspId string, cert *x509.Certificate, privateKey interface{}) *identity
func SerializedCertName ¶
func SignCertsPath ¶
func SignerFromMSPPath ¶
Types ¶
type MSPConfig ¶
type MSPConfig struct {
// contains filtered or unexported fields
}
func MSPFromConfig ¶
func MSPFromConfig(fabricMspConfig *mspproto.FabricMSPConfig) (*MSPConfig, error)
MSPFromConfig created msp config from msp.FabricMSPConfig
func MSPFromPath ¶
MSPFromPath loads msp config from filesystem
func MustMSPFromPath ¶
func (*MSPConfig) AdminOrSigner ¶
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 (*MSPConfig) GetMSPIdentifier ¶
func (*MSPConfig) MSPConfig ¶
func (m *MSPConfig) MSPConfig() *mspproto.FabricMSPConfig
type MSPFiles ¶
func SerializeMSP ¶
func SerializeMSP(fabricMSPConfig *mspproto.FabricMSPConfig) (MSPFiles, error)
func (MSPFiles) MergeToPath ¶
type MSPOpt ¶
type MSPOpt func(opts *MSPOpts)
func WithAdminMSPPath ¶
func WithSignCert ¶ added in v0.8.3
func WithSignCertPath ¶
func WithSignKey ¶ added in v0.8.3
func WithSignKeyPath ¶
func WithSkipConfig ¶
func WithSkipConfig() MSPOpt
Click to show internal directories.
Click to hide internal directories.