public abstract class CredManagerBackedSecureStore<E extends Secret> extends Object implements SecretStore<E>
| Constructor and Description |
|---|
CredManagerBackedSecureStore() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(String key,
E secret)
Add the specified secret to Windows Credential Manager
Multi-thread safe, synchronized access to store
|
protected abstract E |
create(String username,
String secret)
Create a
Secret from the string representation |
boolean |
delete(String key)
Delete the stored credential from Credential Manager
Multi-thread safe, synchronized access to store
|
E |
get(String key)
Read calls CredRead on Windows and retrieve the Secret
Multi-thread safe, synchronized access to store
|
protected abstract String |
getCredentialBlob(E secret)
Get String representation of the CredentialBlob field from the secret
|
protected abstract String |
getUsername(E secret)
Get String representation of the UserName field from the
Secret |
boolean |
isSecure()
Windows credential manager is considered a secure storage for secrets
|
protected abstract E create(String username, String secret)
Secret from the string representationusername - username for the secretsecret - password, oauth2 access token, or Personal Access TokenSecret from the inputprotected abstract String getUsername(E secret)
Secretsecret - A Credential, Token or TokenPairprotected abstract String getCredentialBlob(E secret)
secret - A Credential, Token or TokenPairpublic E get(String key)
get in interface SecretStore<E extends Secret>key - TargetName in the credential structurepublic boolean delete(String key)
delete in interface SecretStore<E extends Secret>key - TargetName in the credential structurepublic boolean add(String key, E secret)
add in interface SecretStore<E extends Secret>key - TargetName in the credential structuresecret - secret to be storedtrue if successfully added
false otherwisepublic boolean isSecure()
isSecure in interface SecretStore<E extends Secret>true for Windows Credential ManagerCopyright © 2018. All rights reserved.