Constructor and Description |
---|
NullMslStore() |
Modifier and Type | Method and Description |
---|---|
void |
addServiceTokens(java.util.Set<ServiceToken> tokens)
Add a set of service tokens to the store.
|
void |
addUserIdToken(java.lang.String userId,
UserIdToken userIdToken)
Add a user ID token to the store, replacing any existing user ID token
of the same user.
|
void |
clearCryptoContexts()
Removes all master tokens and crypto contexts and bound user ID tokens
and their bound service tokens.
|
void |
clearServiceTokens()
Removes all service tokens.
|
void |
clearUserIdTokens()
Removes all user ID tokens and user ID token bound service tokens.
|
ICryptoContext |
getCryptoContext(MasterToken masterToken)
Return the crypto context associated with the provided master token.
|
MasterToken |
getMasterToken()
Return the newest saved master token in this store.
|
long |
getNonReplayableId(MasterToken masterToken)
Return the next non-replayable ID of the provided master token.
|
java.util.Set<ServiceToken> |
getServiceTokens(MasterToken masterToken,
UserIdToken userIdToken)
Return the set of service tokens that are applicable to the provided
pair of master token and user ID token.
|
UserIdToken |
getUserIdToken(java.lang.String userId)
Returns the user ID token, if any, for the specified local user ID.
|
void |
removeCryptoContext(MasterToken masterToken)
Remove a master token and its associated crypto context.
|
void |
removeServiceTokens(java.lang.String name,
MasterToken masterToken,
UserIdToken userIdToken)
Remove all service tokens matching all the specified parameters.
|
void |
removeUserIdToken(UserIdToken userIdToken)
Remove a user ID token.
|
void |
setCryptoContext(MasterToken masterToken,
ICryptoContext cryptoContext)
Save a master token and its associated crypto context.
|
public void setCryptoContext(MasterToken masterToken, ICryptoContext cryptoContext)
MslStore
MslStore.removeCryptoContext(MasterToken)
.setCryptoContext
in interface MslStore
masterToken
- the master token.cryptoContext
- the crypto context. May be null.public MasterToken getMasterToken()
MslStore
getMasterToken
in interface MslStore
public long getNonReplayableId(MasterToken masterToken)
MslStore
MslConstants.MAX_LONG_VALUE
is zero (0).getNonReplayableId
in interface MslStore
public ICryptoContext getCryptoContext(MasterToken masterToken)
MslStore
getCryptoContext
in interface MslStore
masterToken
- the master token.public void removeCryptoContext(MasterToken masterToken)
MslStore
removeCryptoContext
in interface MslStore
masterToken
- the master token.public void clearCryptoContexts()
MslStore
clearCryptoContexts
in interface MslStore
public void addUserIdToken(java.lang.String userId, UserIdToken userIdToken)
MslStore
addUserIdToken
in interface MslStore
userId
- local user ID.userIdToken
- the user ID token.public UserIdToken getUserIdToken(java.lang.String userId)
MslStore
getUserIdToken
in interface MslStore
userId
- local user ID.public void removeUserIdToken(UserIdToken userIdToken)
MslStore
removeUserIdToken
in interface MslStore
userIdToken
- the user ID token.public void clearUserIdTokens()
MslStore
clearUserIdTokens
in interface MslStore
public void addServiceTokens(java.util.Set<ServiceToken> tokens)
MslStore
Add a set of service tokens to the store.
Either all or none of the provided service tokens will be added.
addServiceTokens
in interface MslStore
tokens
- the service tokens.public java.util.Set<ServiceToken> getServiceTokens(MasterToken masterToken, UserIdToken userIdToken) throws MslException
MslStore
Return the set of service tokens that are applicable to the provided pair of master token and user ID token. The base set consists of the service tokens that are not bound to any master token or user ID token.
If a master token is provided, the service tokens that are bound to the master token and not bound to any user ID token are also provided.
If a master token and user ID token is provided, the service tokens that are bound to both the master token and user ID token are also provided.
getServiceTokens
in interface MslStore
masterToken
- the master token. May be null.userIdToken
- the user ID token. May be null.MslException
- if the user ID token is not bound to the master
token or a user ID token is provided without also providing a
master token.public void removeServiceTokens(java.lang.String name, MasterToken masterToken, UserIdToken userIdToken) throws MslException
MslStore
Remove all service tokens matching all the specified parameters.
If a name is provided, only tokens with that name are removed. If a master token is provided, only tokens bound to that master token are removed. If a user ID token is provided, only tokens bound to that user ID token are removed.
For example, if a name and master token is provided, only tokens with that name and bound to that master token are removed.
If no parameters are provided, no tokens are removed.
removeServiceTokens
in interface MslStore
name
- service token name. May be null.masterToken
- master token. May be null.userIdToken
- user ID token. May be null.MslException
- if the user ID token is not bound to the master
token.public void clearServiceTokens()
MslStore
clearServiceTokens
in interface MslStore