Suspending, Resuming, or Revoking a PKI Credential
To suspend, resume, or revoke a PKI credential, complete the following steps:
-
Instantiate and open a session to the CredentialManager and WalletManager client.
-
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()) }; -
Find the credential IDs of all credentials to be suspended, resumed, or revoked (with the method used, findCredentialIds).
CopyCredentialId[] credIds = cm. findCredentialIds(criteria, maxItem);
-
Initiate the suspension, resumption, or revocation workflow using the supplied parameters (with the method used, performProcess).
-
To suspend, use the following:
Copycm.performProcess(credIds[0], CCMConstants.
PROCESS_ID_CRED_SUSPEND, new Parameter[0]);
-
To resume, use the following:
Copycm.performProcess(credIds[0], CCMConstants.
PROCESS_ID_CRED_RESUME, new Parameter[0]);
-
To revoke, use the following:
Copycm.performProcess(credIds[0], CCMConstants.
PROCESS_ID_CRED_REVOKE, new Parameter[0]);
-