Class: IdentityContext

IdentityContext

This class represents a IdentityContext, the user identity. This object will be used to provide the identity on outbound requests to the fabric network. This object will be the source of transaction ids that must be based on an identity. The nonce values will be also be calculated and kept here for convenience.

see the tutorial proposal


new IdentityContext(user, client)

Construct a IdentityContext object.
Parameters:
Name Type Description
user User The user identity instance
client Client
Returns:
The IdentityContext instance.
Type
IdentityContext

Methods


calculateTransactionId()

Create a new transaction ID value. The new transaction ID will be set both on this object and on the return value, which is a copy of this identity context. Calls to this function will not affect the transaction ID value on copies returned from previous calls.
Returns:
A copy of this identity context.

serializeIdentity()

Get the protobuf serialized identity of this user
Returns:
serialized identity in bytes
Type
Buffer

sign(payload)

Sign the bytes provided
Parameters:
Name Type Description
payload Buffer The payload bytes that require a signature
Returns:
- The signature in bytes
Type
Buffer

toString()

return a printable representation of this object