Suspending, Resuming, or Revoking a PKI Credential

To suspend, resume, or revoke a PKI credential, complete the following steps:

  1. Instantiate and open a session to the CredentialManager and WalletManager client.

  2. Set up search criteria based on credential type (optional), parent wallet (required), and application ID (required).

    Copy
    //In the sample code, PKI1 is the name of an application
    Criteria[] criteria = {
    new Criteria(CCMConstants.CRITERIA_CRED_TYPE, CCMConstants.CRITERIA_COMPARISON_EQUAL,
    CCMConstants.CRED_ID_TYPE_PKI), new Criteria(CCMConstants.
    CRITERIA_CRED_APPLICATION_ID, CCMConstants.CRITERIA_COMPARISON_EQUAL, "PKI1"),
    new Criteria(CCMConstants.
    CRITERIA_CRED_PARENT_WALLET, CCMConstants.CRITERIA_COMPARISON_EQUAL, walletId.getId()) };
  3. Find the credential IDs of all credentials to be suspended, resumed, or revoked (with the method used, findCredentialIds).

    Copy
    CredentialId[] credIds = cm. findCredentialIds(criteria, maxItem);
  4. Initiate the suspension, resumption, or revocation workflow using the supplied parameters (with the method used, performProcess).

    • To suspend, use the following:

      Copy
      cm.performProcess(credIds[0], CCMConstants.
      PROCESS_ID_CRED_SUSPEND, new Parameter[0]);
    • To resume, use the following:

      Copy
      cm.performProcess(credIds[0], CCMConstants.
      PROCESS_ID_CRED_RESUME, new Parameter[0]);
    • To revoke, use the following:

      Copy
      cm.performProcess(credIds[0], CCMConstants.
      PROCESS_ID_CRED_REVOKE, new Parameter[0]);