Skip to content

Commit

Permalink
[FABN-899] update docs for enroll()
Browse files Browse the repository at this point in the history
update jsdoc for enroll() at FabricCAService

Change-Id: If78c8950559f3261262e27fd326410279f6e7b34
Signed-off-by: zhaochy <[email protected]>
  • Loading branch information
zhaochy1990 committed Nov 29, 2018
1 parent 6eefe64 commit 3c50e3a
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions fabric-ca-client/lib/FabricCAServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,22 @@ const FabricCAServices = class extends BaseClient {
* @property {AttributeRequest[]} attr_reqs - An array of {@link AttributeRequest}
*/

/**
* @typedef {Object} Enrollment
* @property {Object} key - the private key
* @property {string} certificate - The enrollment certificate in base 64 encoded PEM format
* @property {string} rootCertificate - Base 64 encoded PEM-encoded certificate chain of the CA's signing certificate
*/

/**
* Enroll the member and return an opaque member object.
* @param req the {@link EnrollmentRequest}
* @returns Promise for an object with "key" for private key and "certificate" for the signed certificate
*
* @param req the {@link EnrollmentRequest} If the request contains the field "csr", this csr will be used for
* getting the certificate from Fabric-CA. Otherwise , a new private key will be generated and be used to
* generate a csr later.
* @returns {Promise<Enrollment>} If the request does not contain the field "csr", the returned promise resolves an
* {@link Enrollment} object with "key" for the new generated private key. If the request contains the field "csr",
* the resolved {@link Enrollment} object does not contain the property "key".
*/
async enroll(req) {
if (!req) {
Expand Down

0 comments on commit 3c50e3a

Please sign in to comment.