Class PingOneWalletClient
java.lang.Object
com.pingidentity.sdk.pingonewallet.client.PingOneWalletClient
- All Implemented Interfaces:
com.pingidentity.did.sdk.client.LinkHandler,com.pingidentity.sdk.pingonewallet.client.DidMessageListener,com.pingidentity.sdk.pingonewallet.contracts.PingOneWalletClientContract
public class PingOneWalletClient
extends Object
implements com.pingidentity.sdk.pingonewallet.contracts.PingOneWalletClientContract, com.pingidentity.sdk.pingonewallet.client.DidMessageListener, com.pingidentity.did.sdk.client.LinkHandler
Client class to interact with Credentials and manage Wallet
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidCall this method to check if wallet has received any new messages in the mailbox.io.reactivex.rxjava3.core.Single<com.pingidentity.did.sdk.types.Claim> createSelfClaim(Map<String, String> map, com.pingidentity.did.sdk.client.service.model.ApplicationInstance applicationInstance) Call this method to create a map of self attested claimsio.reactivex.rxjava3.core.CompletableDisable push to stop receiving notifications from the servicefindMatchingCredentialsForRequest(PresentationRequest request, List<com.pingidentity.did.sdk.types.Claim> credentials) Call this method to filter the verifiable credentials that match the schema defined in the input descriptor in the presentation request.com.pingidentity.did.sdk.client.service.model.ApplicationInstancegetApplicationInstance(PingOneRegion walletRegion) Returns ApplicationInstance used to register the wallet in PingOneRegionCall this method to get the DataRepository that is used by the SDK to store credentials and other information.getRegionForApplicationInstance(com.pingidentity.did.sdk.client.service.model.ApplicationInstance applicationInstance) Call this method to get the StorageManagerContract that is used by the SDK to store credentials and other information.voidhandleClaim(UUID sender, String message, com.pingidentity.did.sdk.client.service.model.Challenge challenge, com.pingidentity.did.sdk.types.Claim claim, List<com.pingidentity.did.sdk.exception.DidException> errors, com.pingidentity.did.sdk.client.service.model.ApplicationInstance applicationInstance) voidhandleError(Exception e, com.pingidentity.did.sdk.client.service.model.ApplicationInstance appInstance) voidhandleException(com.pingidentity.did.sdk.exception.DidException error, com.pingidentity.did.sdk.client.service.model.ApplicationInstance appInstance) voidhandleExpiredClaim(UUID sender, String message, com.pingidentity.did.sdk.client.service.model.Challenge challenge, com.pingidentity.did.sdk.types.ClaimReference claimReference, List<com.pingidentity.did.sdk.exception.DidException> errors, com.pingidentity.did.sdk.client.service.model.ApplicationInstance applicationInstance) voidhandleOpenID4VerifiablePresentationRequest(com.pingidentity.did.sdk.w3c.verifiableCredential.VerifiablePresentationRequest request, com.pingidentity.did.sdk.client.OpenIDVerifiableCredentialsClient openIDVerifiableCredentialsClient) voidhandleRequest(com.pingidentity.did.sdk.types.Request request, com.pingidentity.did.sdk.client.service.model.ApplicationInstance appInstance) voidhandleSecureMessage(UUID senderId, String message, com.pingidentity.did.sdk.client.service.model.Challenge challenge, com.pingidentity.did.sdk.client.service.model.ApplicationInstance appInstance) voidhandleShare(UUID senderId, String message, com.pingidentity.did.sdk.client.service.model.Challenge challenge, List<com.pingidentity.did.sdk.types.Share> shares, List<com.pingidentity.did.sdk.exception.DidException> errors, com.pingidentity.did.sdk.client.service.model.ApplicationInstance appInstance) voidhandleShareRequest(UUID senderId, String message, com.pingidentity.did.sdk.client.service.model.Challenge challenge, List<String> shares, com.pingidentity.did.sdk.client.service.model.ApplicationInstance appInstance) voidhandleWalletError(com.pingidentity.sdk.pingonewallet.errors.WalletException err) voidhandleWalletMessage(String sender, String message, com.pingidentity.did.sdk.client.service.model.Challenge challenge, com.pingidentity.did.sdk.client.service.model.ApplicationInstance applicationInstance) com.pingidentity.did.sdk.client.service.model.ApplicationInstancepairWallet(PairingRequest pairingRequest, String pushToken) Call this function to pair your wallet app for future issuance and receive credential updatescom.pingidentity.did.sdk.client.service.model.ApplicationInstancepairWallet(PresentationRequest presentationRequest, String pushToken) Deprecated.This method is deprecated and will be removed in upcoming updates.voidHelper method to start polling for new messages sent to the wallet.io.reactivex.rxjava3.core.Single<PresentationResult> presentCredentials(CredentialsPresentation presentation) Call this method to share the presentation with the requesterbooleanprocessNotification(Map<Object, Object> userInfo) Forward content from push notifications payload for processing.voidprocessPingOneRequest(PingOneRegion region, String request) voidprocessPingOneRequest(String qrContent) Forward content from QR codes and universal links for processing.voidprocessQrContent(String qrContent) Deprecated.This method is deprecated and will be removed in upcoming updates.voidregisterCallbackHandler(WalletCallbackHandler callbackHandler) Call this method to register a callback handler to listen for wallet actionsvoidregisterStorageManager(StorageManagerContract storageManager) Call this method to register the optional storage manager that can be used by the SDK to maintain the values for claims and other data.voidreportCredentialDeletion(com.pingidentity.did.sdk.types.Claim claim) Call this method when a credential is deleted from the Wallet.static voidThis method erases all the credentials and key pairs associated with the wallet and resets it to a clean state.voidCall this method to stop polling for messages sent to the walletio.reactivex.rxjava3.core.CompletableupdatePushNotificationToken(String pushToken) Update push token to receive notifications from the servicecom.pingidentity.did.sdk.client.service.model.ApplicationInstanceupdatePushToken(String pushToken) Deprecated.This method is deprecated and will be removed in upcoming updates.List<com.pingidentity.did.sdk.client.service.model.ApplicationInstance> updatePushTokens(String pushToken) Deprecated.This method is deprecated and will be removed in upcoming updates.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.pingidentity.did.sdk.client.LinkHandler
handleError, handleRequest
-
Field Details
-
TAG
-
-
Method Details
-
reset
This method erases all the credentials and key pairs associated with the wallet and resets it to a clean state. The data is not recoverable after this method is executed. Must callPingOneWalletClient.Builder.build(FragmentActivity, Consumer, Consumer)} to use the wallet again.- Parameters:
context- Application context
-
registerStorageManager
Call this method to register the optional storage manager that can be used by the SDK to maintain the values for claims and other data.- Specified by:
registerStorageManagerin interfacecom.pingidentity.sdk.pingonewallet.contracts.PingOneWalletClientContract- Parameters:
storageManager- Implementation of StorageManagerContract interface- See Also:
-
getStorageManager
Call this method to get the StorageManagerContract that is used by the SDK to store credentials and other information.- Specified by:
getStorageManagerin interfacecom.pingidentity.sdk.pingonewallet.contracts.PingOneWalletClientContract- Returns:
- Registered instance of StorageManagerContract interface implementation
-
getDataRepository
Call this method to get the DataRepository that is used by the SDK to store credentials and other information.- Specified by:
getDataRepositoryin interfacecom.pingidentity.sdk.pingonewallet.contracts.PingOneWalletClientContract- Returns:
- An instance of DataRepository using the registered StorageManagerContract
-
registerCallbackHandler
Call this method to register a callback handler to listen for wallet actions- Specified by:
registerCallbackHandlerin interfacecom.pingidentity.sdk.pingonewallet.contracts.PingOneWalletClientContract- Parameters:
callbackHandler- Instance of WalletCallbackHandler to handle important events such as credential issuance/revocation etc.
-
getApplicationInstance
public com.pingidentity.did.sdk.client.service.model.ApplicationInstance getApplicationInstance(PingOneRegion walletRegion) Returns ApplicationInstance used to register the wallet in PingOneRegion- Parameters:
walletRegion- : PingOneRegion- Returns:
- ApplicationInstance containing keys and ID for the SDK instance for the PingOneRegion
-
getRegionForApplicationInstance
public PingOneRegion getRegionForApplicationInstance(com.pingidentity.did.sdk.client.service.model.ApplicationInstance applicationInstance) -
pairWallet
public com.pingidentity.did.sdk.client.service.model.ApplicationInstance pairWallet(@NonNull PairingRequest pairingRequest, @Nullable String pushToken) throws com.pingidentity.sdk.pingonewallet.errors.WalletException Call this function to pair your wallet app for future issuance and receive credential updates- Specified by:
pairWalletin interfacecom.pingidentity.sdk.pingonewallet.contracts.PingOneWalletClientContract- Parameters:
pairingRequest- : PairingRequest from service for wallet pairing containing the issuer ID and optional challenge required for pairingpushToken- : Optional push token- Returns:
- Returns the ApplicationInstance registered for pairing
- Throws:
com.pingidentity.sdk.pingonewallet.errors.WalletException- if pairing is unsuccessful
-
pairWallet
@Deprecated public com.pingidentity.did.sdk.client.service.model.ApplicationInstance pairWallet(@NonNull PresentationRequest presentationRequest, @Nullable String pushToken) throws com.pingidentity.sdk.pingonewallet.errors.WalletException Deprecated.This method is deprecated and will be removed in upcoming updates. UsepairWallet(PairingRequest pairingRequest, String pushToken)instead.- Specified by:
pairWalletin interfacecom.pingidentity.sdk.pingonewallet.contracts.PingOneWalletClientContract- Throws:
com.pingidentity.sdk.pingonewallet.errors.WalletException
-
updatePushToken
@Deprecated public com.pingidentity.did.sdk.client.service.model.ApplicationInstance updatePushToken(@NonNull String pushToken) Deprecated.This method is deprecated and will be removed in upcoming updates. UseupdatePushNotificationToken(String pushToken)instead.- Specified by:
updatePushTokenin interfacecom.pingidentity.sdk.pingonewallet.contracts.PingOneWalletClientContract
-
updatePushTokens
@Deprecated public List<com.pingidentity.did.sdk.client.service.model.ApplicationInstance> updatePushTokens(String pushToken) Deprecated.This method is deprecated and will be removed in upcoming updates. UseupdatePushNotificationToken(String pushToken)instead.- Specified by:
updatePushTokensin interfacecom.pingidentity.sdk.pingonewallet.contracts.PingOneWalletClientContract
-
updatePushNotificationToken
Description copied from interface:com.pingidentity.sdk.pingonewallet.contracts.PingOneWalletClientContractUpdate push token to receive notifications from the service- Specified by:
updatePushNotificationTokenin interfacecom.pingidentity.sdk.pingonewallet.contracts.PingOneWalletClientContract- Parameters:
pushToken- Firebase Push Token- Returns:
- Completable to indicate successful update or errors
-
disablePush
public io.reactivex.rxjava3.core.Completable disablePush()Description copied from interface:com.pingidentity.sdk.pingonewallet.contracts.PingOneWalletClientContractDisable push to stop receiving notifications from the service- Specified by:
disablePushin interfacecom.pingidentity.sdk.pingonewallet.contracts.PingOneWalletClientContract- Returns:
- Completable to indicate successful update or errors
-
processQrContent
Deprecated.This method is deprecated and will be removed in upcoming updates. Use processPingOneRequest insteadHandle URL for issuance or presentation- Specified by:
processQrContentin interfacecom.pingidentity.sdk.pingonewallet.contracts.PingOneWalletClientContract- Parameters:
qrContent- Raw content from the QR code
-
processPingOneRequest
Forward content from QR codes and universal links for processing. Make sure to register the callbackhandler beforehand to receive the result.- Specified by:
processPingOneRequestin interfacecom.pingidentity.sdk.pingonewallet.contracts.PingOneWalletClientContract- Parameters:
qrContent- : Raw content from the QR code
-
processPingOneRequest
-
processNotification
Forward content from push notifications payload for processing. Make sure to register the callbackhandler beforehand to receive the result.- Specified by:
processNotificationin interfacecom.pingidentity.sdk.pingonewallet.contracts.PingOneWalletClientContract- Parameters:
userInfo- : Push notification payload- Returns:
- true if the notification can be handled by Wallet SDK and false if the SDK cannot recognize it as a PingOne notification
-
pollForMessages
public void pollForMessages()Helper method to start polling for new messages sent to the wallet. Use this method only if you are not using push notifications. -
stopPolling
public void stopPolling()Call this method to stop polling for messages sent to the wallet -
checkForMessages
public void checkForMessages()Call this method to check if wallet has received any new messages in the mailbox. This method can be used to check for messages on user action or if push notifications are not available.- Specified by:
checkForMessagesin interfacecom.pingidentity.sdk.pingonewallet.contracts.PingOneWalletClientContract
-
findMatchingCredentialsForRequest
public PresentationMatcherResult findMatchingCredentialsForRequest(@NonNull PresentationRequest request, @NonNull List<com.pingidentity.did.sdk.types.Claim> credentials) Call this method to filter the verifiable credentials that match the schema defined in the input descriptor in the presentation request.- Specified by:
findMatchingCredentialsForRequestin interfacecom.pingidentity.sdk.pingonewallet.contracts.PingOneWalletClientContract- Parameters:
request- PresentationRequest containing the filtering criteria and other metadatacredentials- List of claims saved in the Wallet- Returns:
- PresentationMatherResult containing the list of credentials matching the criteria defined in the presentation request
-
presentCredentials
public io.reactivex.rxjava3.core.Single<PresentationResult> presentCredentials(@NonNull CredentialsPresentation presentation) Call this method to share the presentation with the requester- Specified by:
presentCredentialsin interfacecom.pingidentity.sdk.pingonewallet.contracts.PingOneWalletClientContract- Parameters:
presentation- CredentialPresentation object containing filtered credentials and presentation request- Returns:
- PresentationResult returned after credential presentation
-
createSelfClaim
public io.reactivex.rxjava3.core.Single<com.pingidentity.did.sdk.types.Claim> createSelfClaim(@NonNull Map<String, String> map, com.pingidentity.did.sdk.client.service.model.ApplicationInstance applicationInstance) Call this method to create a map of self attested claims- Parameters:
map- : Map with key-value pairs for claimapplicationInstance- : ApplicationInstance- Returns:
- Self-signed Claim object
-
reportCredentialDeletion
public void reportCredentialDeletion(@NonNull com.pingidentity.did.sdk.types.Claim claim) Call this method when a credential is deleted from the Wallet. Reporting this action will help admins view accurate stats on their dashboards in future.- Specified by:
reportCredentialDeletionin interfacecom.pingidentity.sdk.pingonewallet.contracts.PingOneWalletClientContract- Parameters:
claim- Claim that was deleted from wallet
-
handleOpenID4VerifiablePresentationRequest
public void handleOpenID4VerifiablePresentationRequest(com.pingidentity.did.sdk.w3c.verifiableCredential.VerifiablePresentationRequest request, com.pingidentity.did.sdk.client.OpenIDVerifiableCredentialsClient openIDVerifiableCredentialsClient) - Specified by:
handleOpenID4VerifiablePresentationRequestin interfacecom.pingidentity.did.sdk.client.LinkHandler
-
handleError
public void handleError(Exception e, com.pingidentity.did.sdk.client.service.model.ApplicationInstance appInstance) - Specified by:
handleErrorin interfacecom.pingidentity.sdk.pingonewallet.client.DidMessageListener
-
handleRequest
public void handleRequest(com.pingidentity.did.sdk.types.Request request, com.pingidentity.did.sdk.client.service.model.ApplicationInstance appInstance) - Specified by:
handleRequestin interfacecom.pingidentity.sdk.pingonewallet.client.DidMessageListener
-
handleClaim
public void handleClaim(UUID sender, String message, com.pingidentity.did.sdk.client.service.model.Challenge challenge, com.pingidentity.did.sdk.types.Claim claim, List<com.pingidentity.did.sdk.exception.DidException> errors, com.pingidentity.did.sdk.client.service.model.ApplicationInstance applicationInstance) - Specified by:
handleClaimin interfacecom.pingidentity.sdk.pingonewallet.client.DidMessageListener
-
handleExpiredClaim
public void handleExpiredClaim(UUID sender, String message, com.pingidentity.did.sdk.client.service.model.Challenge challenge, com.pingidentity.did.sdk.types.ClaimReference claimReference, List<com.pingidentity.did.sdk.exception.DidException> errors, com.pingidentity.did.sdk.client.service.model.ApplicationInstance applicationInstance) - Specified by:
handleExpiredClaimin interfacecom.pingidentity.sdk.pingonewallet.client.DidMessageListener
-
handleSecureMessage
public void handleSecureMessage(UUID senderId, String message, com.pingidentity.did.sdk.client.service.model.Challenge challenge, com.pingidentity.did.sdk.client.service.model.ApplicationInstance appInstance) - Specified by:
handleSecureMessagein interfacecom.pingidentity.sdk.pingonewallet.client.DidMessageListener
-
handleException
public void handleException(com.pingidentity.did.sdk.exception.DidException error, com.pingidentity.did.sdk.client.service.model.ApplicationInstance appInstance) - Specified by:
handleExceptionin interfacecom.pingidentity.sdk.pingonewallet.client.DidMessageListener
-
handleWalletError
public void handleWalletError(com.pingidentity.sdk.pingonewallet.errors.WalletException err) -
handleWalletMessage
-