hfc.fabric_ca¶
Submodules¶
Package Contents¶
Classes¶
|
Client for communicating with the Fabric CA APIs. |
|
Handler instances dispatch logging events to specific destinations. |
-
class
hfc.fabric_ca.CAClient(target=DEFAULT_CA_ENDPOINT, ca_certs_path=None, base_url=DEFAULT_CA_BASE_URL, ca_name='', cryptoPrimitives=ecies())¶ Bases:
objectClient for communicating with the Fabric CA APIs.
-
generateAuthToken(self, req, registrar)¶ Generate authorization token required for accessing fabric-ca APIs
- Parameters
req (dict) – request body
registrar – Required. The identity of the registrar
(i.e. who is performing the request) :type registrar: Enrollment :return: auth token
-
_send_ca_post(self, path, **param)¶ Send a post request to the ca service
- Parameters
path – sub path after the base_url
**param –
post request params
- Returns
the response body in json
-
_send_ca_get(self, path, **param)¶ Send a get request to the ca service
- Parameters
path – sub path after the base_url
**param –
get request params
- Returns
the response body in json
-
_send_ca_delete(self, path, **param)¶ Send a delete request to the ca service
- Parameters
path – sub path after the base_url
**param –
delete request params
- Returns
the response body in json
-
_send_ca_update(self, path, **param)¶ Send a update request to the ca service
- Parameters
path – sub path after the base_url
**param –
update request params
- Returns
the response body in json
-
get_cainfo(self)¶ Query the ca service information.
- Returns
The base64 encoded CA PEM file content for the caname
-
enroll(self, enrollment_id, enrollment_secret, csr, profile='', attr_reqs=None)¶
-
register(self, req, registrar)¶
-
reenroll(self, req, registrar)¶
-
revoke(self, req, registrar)¶
-
generateCRL(self, req, registrar)¶
-
newIdentityService(self)¶
-
newAffiliationService(self)¶
-
newCertificateService(self)¶
-
-
class
hfc.fabric_ca.NullHandler(level=NOTSET)¶ Bases:
logging.HandlerHandler instances dispatch logging events to specific destinations.
The base handler class. Acts as a placeholder which defines the Handler interface. Handlers can optionally use Formatter instances to format records as desired. By default, no formatter is specified; in this case, the ‘raw’ message as determined by record.message is logged.
-
emit(self, record)¶ Do whatever it takes to actually log the specified logging record.
This version is intended to be implemented by subclasses and so raises a NotImplementedError.
-