Class GnomeKeyringBackedTokenPairStore
- java.lang.Object
-
- com.microsoft.credentialstorage.implementation.posix.keyring.GnomeKeyringBackedSecureStore<StoredTokenPair>
-
- com.microsoft.credentialstorage.implementation.posix.keyring.GnomeKeyringBackedTokenPairStore
-
- All Implemented Interfaces:
SecretStore<StoredTokenPair>
public final class GnomeKeyringBackedTokenPairStore extends GnomeKeyringBackedSecureStore<StoredTokenPair>
GNOME Keyring store for a token pair.
-
-
Field Summary
-
Fields inherited from class com.microsoft.credentialstorage.implementation.posix.keyring.GnomeKeyringBackedSecureStore
ALLOW_UNLOCK_KEYRING, APP_NAME, ATTRIBUTE_ACCOUNT, ATTRIBUTE_KEY, ATTRIBUTE_TYPE, INSTANCE, logger, SCHEMA
-
-
Constructor Summary
Constructors Constructor Description GnomeKeyringBackedTokenPairStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(String key, StoredTokenPair secret)Save the secret identified by the key to this store.protected StoredTokenPaircreate(String username, char[] secret)Create aSecretfrom the string representationbooleandelete(String key)Delete a secret from GNOME Keyring.StoredTokenPairget(String key)Read a secret from GNOME Keyring using its item API to get attributes containing username.protected StringgetType()Return the type of this secure store, used to match the secret in GNOME Keyring-
Methods inherited from class com.microsoft.credentialstorage.implementation.posix.keyring.GnomeKeyringBackedSecureStore
checkResult, deleteSecret, isSecure, isSupported, readSecret, writeSecret
-
-
-
-
Method Detail
-
get
public StoredTokenPair get(String key)
Description copied from class:GnomeKeyringBackedSecureStoreRead a secret from GNOME Keyring using its item API to get attributes containing username.- Specified by:
getin interfaceSecretStore<StoredTokenPair>- Overrides:
getin classGnomeKeyringBackedSecureStore<StoredTokenPair>- Parameters:
key- for which a secret is associated with- Returns:
- secret
-
add
public boolean add(String key, StoredTokenPair secret)
Description copied from interface:SecretStoreSave the secret identified by the key to this store. Replace existing secret if it exists.- Parameters:
key- for which a secret is associated withsecret- secret to be stored- Returns:
trueif secret is added successfullyfalseotherwise
-
delete
public boolean delete(String key)
Description copied from class:GnomeKeyringBackedSecureStoreDelete a secret from GNOME Keyring.- Specified by:
deletein interfaceSecretStore<StoredTokenPair>- Overrides:
deletein classGnomeKeyringBackedSecureStore<StoredTokenPair>- Parameters:
key- for which a secret is associated with- Returns:
- true if operation succeeded
-
create
protected StoredTokenPair create(String username, char[] secret)
Description copied from class:GnomeKeyringBackedSecureStoreCreate aSecretfrom the string representation- Specified by:
createin classGnomeKeyringBackedSecureStore<StoredTokenPair>- Parameters:
username- username for the secretsecret- password, oauth2 access token, or Personal Access Token- Returns:
- a
Secretfrom the input
-
getType
protected String getType()
Description copied from class:GnomeKeyringBackedSecureStoreReturn the type of this secure store, used to match the secret in GNOME Keyring- Specified by:
getTypein classGnomeKeyringBackedSecureStore<StoredTokenPair>- Returns:
- type string representation of the secret type
-
-