Class LibSecretBackedTokenPairStore
- java.lang.Object
-
- com.microsoft.credentialstorage.implementation.posix.libsecret.LibSecretBackedSecureStore<StoredTokenPair>
-
- com.microsoft.credentialstorage.implementation.posix.libsecret.LibSecretBackedTokenPairStore
-
- All Implemented Interfaces:
SecretStore<StoredTokenPair>
public final class LibSecretBackedTokenPairStore extends LibSecretBackedSecureStore<StoredTokenPair>
Libsecret store for a token pair.
-
-
Field Summary
-
Fields inherited from class com.microsoft.credentialstorage.implementation.posix.libsecret.LibSecretBackedSecureStore
ALLOW_UNLOCK_DEFAULT_COLLECTION, APP_NAME, ATTRIBUTE_ACCOUNT, ATTRIBUTE_KEY, ATTRIBUTE_TYPE, INSTANCE, logger, SCHEMA
-
-
Constructor Summary
Constructors Constructor Description LibSecretBackedTokenPairStore()
-
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 Libsecret.StoredTokenPairget(String key)Read a secret from Libsecret using its item API to get attributes containing username.protected StringgetType()Return the type of this secure store, used to match the secret in Libsecret-
Methods inherited from class com.microsoft.credentialstorage.implementation.posix.libsecret.LibSecretBackedSecureStore
checkResult, deleteSecret, isLibSecretSupported, isSecure, isSupported, readSecret, writeSecret
-
-
-
-
Method Detail
-
get
public StoredTokenPair get(String key)
Description copied from class:LibSecretBackedSecureStoreRead a secret from Libsecret using its item API to get attributes containing username.- Specified by:
getin interfaceSecretStore<StoredTokenPair>- Overrides:
getin classLibSecretBackedSecureStore<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:LibSecretBackedSecureStoreDelete a secret from Libsecret.- Specified by:
deletein interfaceSecretStore<StoredTokenPair>- Overrides:
deletein classLibSecretBackedSecureStore<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:LibSecretBackedSecureStoreCreate aSecretfrom the string representation- Specified by:
createin classLibSecretBackedSecureStore<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:LibSecretBackedSecureStoreReturn the type of this secure store, used to match the secret in Libsecret- Specified by:
getTypein classLibSecretBackedSecureStore<StoredTokenPair>- Returns:
- type string representation of the secret type
-
-