Published in


Attribute-Based Access Control (ABAC) in Hyperledger fabric

  1. First, let's talk about certification creation with attributes.
  • An admin (registrar) is enrolled in the CA. Then the admin receives the signing key and certificate for this admin.
  • The admin then registers user1 into the CA with proper information. The CA returns with a secret.
  • This secret is then used to enroll user1 to the CA. The result is the signing key and certificate for user1.

Discover and review best Blockchain softwares

fabric_ca_client.register({ enrollmentID: username, affiliation: ‘org1.department1’, role: ‘client’, attrs: [{ name: ‘role’, value: ‘approver’, ecert: true }] }, admin_user);
fabric_ca_client.enroll({ enrollmentID: username, enrollmentSecret: secret, attr_reqs: [{ name: “role”, optional: false }]});
  1. Go Smart Contract
  • The type of stub variable is ChaincodeStubInterface as passed to your chaincode.
  • You have added the following import statement to your chaincode.


Get Best Software Deals Directly In Your Inbox



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store