public interface CredentialStore extends OpssServiceInstance
Each map name is mapped to a CredentialMap
, which is a secure map of keys to Credential
objects.
The operations on this interface are secured by CredentialAccessPermission
.
OpssServiceInstance.State
JpsPersistable.Mode
Modifier and Type | Method and Description |
---|---|
boolean |
containsCredential(java.lang.String mapName, java.lang.String key)
Returns
true if an entry associated with the specified map name for this key exist in this store, false otherwise. |
boolean |
containsMap(java.lang.String mapName)
Returns
true if an map associated with the specified map name exist in this store, false otherwise. |
void |
deleteAllCredentials()
Removes all the
Credential objects from this CredentialStore You need delete CredentialAccessPermission permission to execute this API. |
void |
deleteCredential(java.lang.String mapName, java.lang.String key)
Removes the
Credential objects associated with the specified mapName and key . |
void |
deleteCredentialMap(java.lang.String mapName)
Removes the
CredentialMap objects associated with the specified mapName . |
void |
deleteStore()
Deprecated.
This has beed deprecated because there are no explicit delete of store are supported.
|
java.util.Set<java.lang.String> |
getAliases()
Deprecated.
This method has been deprecated. Please use
getMapNames instead. |
Credential |
getCredential(java.lang.String mapName, java.lang.String key)
Returns the
Credential objects associated with the specified mapName and key . |
CredentialMap |
getCredentialMap(java.lang.String mapName)
Returns the
CredentialMap of Credential objects associated with the specified mapName . |
java.util.Set<java.lang.String> |
getMapNames()
Returns the
Set of all the available mapName . |
java.util.Map<java.lang.String,java.lang.String> |
getProperties()
Returns the configured properties for this instance
|
void |
resetCredential(java.lang.String mapName, java.lang.String key, Credential credential)
Overrides the
Credential object for the specified mapName and key . |
void |
resetCredentialMap(java.lang.String mapName, CredentialMap credentialMap)
Overrides the
CredentialMap of Credential objects for the specified mapName . |
void |
setCredential(java.lang.String mapName, java.lang.String key, Credential credential)
Stores the
Credential object for the specified mapName and key . |
void |
setCredentialMap(java.lang.String mapName, CredentialMap credentialMap)
Stores the
CredentialMap of Credential objects for the specified mapName . |
void |
store()
Deprecated.
This method has been deprecated. Please use
persist if needed. |
java.lang.String |
toString()
Returns the store name as string representation of this Credential Store.
|
getState
accept, getName, getServiceProvider
persist, refresh
boolean containsMap(java.lang.String mapName) throws CredStoreException, java.security.AccessControlException
true
if an map associated with the specified map name exist
in this store, false otherwise. You need read CredentialAccessPermission
permission to execute this API.mapName
- The name of the map. Must be non-null and length must be greater than zero.CredStoreException
- - if the Credential Store has not been initializedjava.security.AccessControlException
- - if a requested access to credentials or store is deniedboolean containsCredential(java.lang.String mapName, java.lang.String key) throws CredStoreException, java.security.AccessControlException
true
if an entry associated with the specified map name for this key exist
in this store, false otherwise. You need read CredentialAccessPermission
permission to execute this API.mapName
- The name of the map. Must be non-null and length must be greater than zero.key
- This Credential key of this map name. Must be non-null and length must be greater than zero.CredStoreException
- - if the Credential Store has not been initializedjava.security.AccessControlException
- - if a requested access to credentials or store is denied@Deprecated java.util.Set<java.lang.String> getAliases() throws CredStoreException, java.security.AccessControlException
getMapNames
instead.Set
of all the available mapName
. You need read CredentialAccessPermission
permission to execute this API.CredStoreException
- - if the Credential Store has not been initializedjava.security.AccessControlException
- - if a requested access to credentials or store is deniedgetMapNames
java.util.Set<java.lang.String> getMapNames() throws CredStoreException, java.security.AccessControlException
Set
of all the available mapName
. You need read CredentialAccessPermission
permission to execute this API.CredStoreException
- - if the Credential Store has not been initializedjava.security.AccessControlException
- - if a requested access to credentials or store is deniedCredential getCredential(java.lang.String mapName, java.lang.String key) throws CredentialExpiredException, CredStoreException, java.security.AccessControlException
Credential
objects associated with the specified mapName
and key
. Returns null if this Credential is not found. This is equivalent to getCredentialMap(mapName).getCredential(key). You need read CredentialAccessPermission
permission to execute this API.mapName
- The name of the map. Must be non-null and length must be greater than zero.key
- The Credential key of this map name. Must be non-null and length must be greater than zero.CredentialExpiredException
- - if this credential is already expiredCredStoreException
- - if the Credential Store has not been initialized properly or there is an error.java.security.AccessControlException
- - if a requested access to credentials or store is deniedCredentialMap getCredentialMap(java.lang.String mapName) throws CredStoreException, java.security.AccessControlException
CredentialMap
of Credential
objects associated with the specified mapName
. Returns null if this Credential is not found. You need read CredentialAccessPermission
permission to execute this API.mapName
- The name of the map. Must be non-null and length must be greater than zero.CredStoreException
- - if the Credential Store has not been initialized properly or there is an error.java.security.AccessControlException
- - if a requested access to credentials or store is deniedvoid setCredential(java.lang.String mapName, java.lang.String key, Credential credential) throws CredentialAlreadyExistsException, CredentialInvalidException, CredStoreException, java.security.AccessControlException
Credential
object for the specified mapName
and key
. By default, this method always persits this credential to store. See also store
method. You need write CredentialAccessPermission
permission to execute this API.mapName
- The name of the map. Must be non-null and length must be greater than zero.key
- The name of the Credential key. Must be non-null and length must be greater than zero.credential
- The Credential object to be storedCredentialInvalidException
- - if the credential data is not valid and can not be storedCredentialAlreadyExistsException
- - if this credential alrady existsCredStoreException
- - if the Credential Store has not been initialized properly or this Credential Map cannot be set.java.security.AccessControlException
- - if a requested access to credentials or store is deniedvoid resetCredential(java.lang.String mapName, java.lang.String key, Credential credential) throws CredentialInvalidException, CredStoreException, java.security.AccessControlException
Credential
object for the specified mapName
and key
. If the credential already exists, it will override it otherwise new credential will be created. By default, this method always persits this credential to store. See also store
method. You need update CredentialAccessPermission
permission to execute this API.mapName
- The name of the map. Must be non-null and length must be greater than zero.key
- The name of the Credential key. Must be non-null and length must be greater than zero.credential
- The Credential object to be storedCredentialInvalidException
- - if the credential data is not valid and can not be storedCredStoreException
- - if the Credential Store has not been initialized properly or this Credential Map cannot be set.java.security.AccessControlException
- - if a requested access to credentials or store is deniedvoid setCredentialMap(java.lang.String mapName, CredentialMap credentialMap) throws CredentialAlreadyExistsException, CredentialInvalidException, CredStoreException, java.security.AccessControlException
CredentialMap
of Credential
objects for the specified mapName
. By default, this method always persits these credentials to store. See also store
method. You need write CredentialAccessPermission
permission to execute this API.mapName
- The map name. Must be non-null and length must be greater than zero.credentialMap
- Map of all the Credentials. Must not be null.CredentialInvalidException
- - if the credential data is not valid and can not be storedCredentialAlreadyExistsException
- - if this credential alrady existsCredStoreException
- - if the credential store has not been initialized properly or this Credential cannot be set.java.security.AccessControlException
- - if a requested access to credentials or store is deniedvoid resetCredentialMap(java.lang.String mapName, CredentialMap credentialMap) throws CredentialInvalidException, CredStoreException, java.security.AccessControlException
CredentialMap
of Credential
objects for the specified mapName
. If the Map already exists, it will override it, otherwise new map will be created. By default, this method always persits these credentials to store. See also store
method. You need update CredentialAccessPermission
permission to execute this API.mapName
- The map name. Must be non-null and length must be greater than zero.credentialMap
- Map of all the CredentialsCredentialInvalidException
- - if the credential data is not valid and can not be storedCredStoreException
- - if the credential store has not been initialized properly or this Credential cannot be setjava.security.AccessControlException
- - if a requested access to credentials or store is deniedvoid deleteCredential(java.lang.String mapName, java.lang.String key) throws CredentialNotFoundException, CredStoreException, java.security.AccessControlException
Credential
objects associated with the specified mapName
and key
. You need delete CredentialAccessPermission
permission to execute this API.mapName
- The name of the map. Must be non-null and length must be greater than zero.key
- The key for this map name. Must be non-null and length must be greater than zero.CredStoreException
- - if the Credential Store has not been initialized properly or credential cannot be deletedCredentialNotFoundException
- - if this credential does not exist.java.security.AccessControlException
- - if a requested access to credentials or store is deniedvoid deleteCredentialMap(java.lang.String mapName) throws CredentialNotFoundException, CredStoreException, java.security.AccessControlException
CredentialMap
objects associated with the specified mapName
. You need delete CredentialAccessPermission
permission to execute this API.mapName
- The name of the map. Must be non-null and length must be greater than zero.CredStoreException
- - if the Credential Store has not been initialized properly or credential cannot be deletedCredentialNotFoundException
- - if this credential does not exist.java.security.AccessControlException
- - if a requested access to credentials or store is deniedvoid deleteAllCredentials() throws CredStoreException, java.security.AccessControlException
Credential
objects from this CredentialStore
You need delete CredentialAccessPermission
permission to execute this API.CredStoreException
- - if the Credential Store has not been initialized properly or credentials cannot be deletedjava.security.AccessControlException
- - if a requested access to credentials or store is denied@Deprecated void deleteStore() throws CredStoreException, java.security.AccessControlException
CredentialAccessPermission
permission to execute this API.CredStoreException
- - if the credential store has not been initialized properly or this Credential cannot be setjava.security.AccessControlException
- - if a requested access to credentials or store is denied@Deprecated void store() throws CredStoreException, java.security.AccessControlException
persist
if needed.CredentialStore
object explicitly. By default all credentials are persisted implicitly. But this is configurable using property "oracle.security.jps.persist.credstore". This property is true by default. But if this property is set to false, then use persist
method to explicitly persist the credentials if any write/update operation is called on this store. You need write CredentialAccessPermission
permission to execute this API.CredStoreException
- - if the Credential Store has not been initialized properly or credential cannot be saved.java.security.AccessControlException
- - if a requested access to credentials or store is deniedjava.lang.String toString()
toString
in class java.lang.Object
java.util.Map<java.lang.String,java.lang.String> getProperties()