Class: MSPManager

MSPManager

MSPManager is an interface defining a manager of one or more MSPs. This essentially acts as a mediator to MSP calls and routes MSP related calls to the appropriate MSP. This object is immutable, it is initialized once and never changed.

new MSPManager()

Methods


addMSP(config)

Create and add MSP instance to this manager according to configuration information
Parameters:
Name Type Description
config Object A configuration object specific to the implementation. For this implementation it uses the following fields:
`rootCerts`: array of Identity representing trust anchors for validating signing certificates. Required for MSPs used in verifying signatures
`intermediateCerts`: array of Identity representing trust anchors for validating signing certificates. optional for MSPs used in verifying signatures
`admins`: array of Identity representing admin privileges
`signer`: SigningIdentity signing identity. Required for MSPs used in signing
`id`: {string} value for the identifier of this instance
`orgs`: {string} array of organizational unit identifiers
`cryptoSuite': the underlying module:api.CryptoSuite for crypto primitive operations
Returns:
The newly created MSP instance
Type
MSP

deserializeIdentity(serializedIdentity)

DeserializeIdentity deserializes an identity
Parameters:
Name Type Description
serializedIdentity Array.<byte> A protobuf-based serialization of an object with two fields: mspid and idBytes for certificate PEM bytes
Returns:
Promise for an Identity instance
Type
Promise

getMSP()

Returns a validating MSP

getMSPs()

Returns the validating MSPs. Note that this does NOT return the local MSP

loadMSPs(mspConfigs)

Instantiates MSPs for validating identities (like the endorsor in the ProposalResponse). The MSPs loaded via this method require the CA certificate representing the Certificate Authority that signed the identities to be validated. They also optionally contain the certificates for the administrators of the organization that the CA certs represent.
Parameters:
Name Type Description
mspConfigs protos/msp/mspconfig.proto An array of MSPConfig objects as defined by the protobuf protos/msp/mspconfig.proto