Interface Info |
|---|
public interface CredentialClient Client for credential management. |
Qualifier and Type |
Method Name and Description |
|---|---|
public void |
deleteCredential(Credential credential, CredentialCallback<Void> callback) Deletes a credential. |
public void |
findCredential(List<AppIdentity> trustedApps, CredentialCallback<List<Credential>> callback)
CAUTION:
Deprecated. You are advised to use findCredential(SharedCredentialFilter filter, CredentialCallback<List<Credential>> callback). Checks for available credentials, including those saved by this app and those shared to this app by other apps. |
public void |
saveCredential(Credential credential, CredentialCallback<Void> callback) Saves a credential. If the credential already exists, this method will update the credential content. |
public void |
findCredential(SharedCredentialFilter filter, CredentialCallback<List<Credential>> callback) Searches for available credentials, including those saved by this app and those shared to this app by other apps. |
Method |
|---|
deleteCredential(Credential credential, CredentialCallback<Void> callback) Deletes a credential. |
Parameters
Name |
Description |
|---|---|
credential |
Credential to be deleted. Pass the Credential object returned by the findCredential method.
|
callback |
Callback object. |
Method |
|---|
public void findCredential(List<AppIdentity> trustedApps, CredentialCallback<List<Credential>> callback)
CAUTION:
Deprecated. You are advised to use findCredential(SharedCredentialFilter filter, CredentialCallback<List<Credential>> callback). Checks for available credentials, including those saved by this app and those shared to this app by other apps. |
Parameters
Name |
Description |
|---|---|
trustedApps |
List of trusted apps. Only credentials shared by apps in the list will be returned for use, ensuring that only trusted credentials are used. If the parameter value is null, credentials shared by all apps to this app will be returned. You can determine whether to trust and use a credential based on the attribute of its owner. However, you are advised not to set this parameter to null or pass an empty list because potential security risks may exist. |
callback |
Callback object. You can obtain a list of credentials using the onSuccess method. |
Method |
|---|
public void saveCredential(Credential credential, CredentialCallback<Void> callback) Saves a credential to Keyring. An app can use this method to save a new credential or update an existing credential.
|
Parameters
Name |
Description |
|---|---|
credential |
Credential to be saved. |
callback |
Callback object. |
Method |
|---|
findCredential(SharedCredentialFilter filter, CredentialCallback<List<Credential>> callback) Searches for available credentials, including those saved by this app and those shared to this app by other apps. |
Parameters
Name |
Description |
|---|---|
filter |
Filter for shared credentials. For details, please refer to SharedCredentialFilter. |
callback |
Callback object. You can obtain a list of credentials using the onSuccess method. |