new MSP(config)
Setup the MSP instance 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 |
Methods
-
deserializeIdentity(serializedIdentity, storeKey)
-
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 storeKey
boolean if the user should be stored in the key store. Only when false will a promise not be returned Returns:
Promise for an Identity instance or or the Identity object itself if "storeKey" argument is false- Type
- Promise
-
getDefaultSigningIdentity()
-
Returns the default signing identity
Returns:
- Type
- SigningIdentity
-
getId()
-
Get provider identifier
Returns:
- Type
- string
-
getOrganizationUnits()
-
Get organizational unit identifiers
Returns:
- Type
- Array.<string>
-
getPolicy()
-
Obtain the policy to govern changes
Returns:
- Type
- Object
-
getSigningIdentity(identifier)
-
Returns a signing identity corresponding to the provided identifier
Parameters:
Name Type Description identifier
string The identifier of the requested identity object Returns:
- Type
- SigningIdentity
-
toProtobuf()
-
Returns the Protobuf representation of this MSP Config
-
validate(id)
-
Checks whether the supplied identity is valid
Parameters:
Name Type Description id
Identity Returns:
- Type
- boolean