|
Message Security Layer (MSL) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MslStore
The Message Security Layer store manages the local store of master tokens identifying the local entity, user ID tokens identifying local users, and all service tokens issued by the local entity or remote entities. It also provides methods for identifying the tokens that should be included in a message and accessing crypto contexts associated with master tokens.
Applications may wish to ensure the store contains only the newest master token and user ID tokens for the known users at application startup and shutdown.
Implementations must be thread-safe.
MslContext
Method Summary | |
---|---|
void |
addServiceTokens(Set<ServiceToken> tokens)
Add a set of service tokens to the store. |
void |
addUserIdToken(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. |
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(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(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. |
Method Detail |
---|
void setCryptoContext(MasterToken masterToken, ICryptoContext cryptoContext)
removeCryptoContext(MasterToken)
.
masterToken
- the master token.cryptoContext
- the crypto context. May be null.MasterToken getMasterToken()
long getNonReplayableId(MasterToken masterToken)
MslConstants.MAX_LONG_VALUE
is zero (0).
ICryptoContext getCryptoContext(MasterToken masterToken)
masterToken
- the master token.
void removeCryptoContext(MasterToken masterToken)
masterToken
- the master token.void clearCryptoContexts()
void addUserIdToken(String userId, UserIdToken userIdToken) throws MslException
userId
- local user ID.userIdToken
- the user ID token.
MslException
- if the user ID token is not bound to any stored
master token.UserIdToken getUserIdToken(String userId)
userId
- local user ID.
void removeUserIdToken(UserIdToken userIdToken)
userIdToken
- the user ID token.void clearUserIdTokens()
void addServiceTokens(Set<ServiceToken> tokens) throws MslException
tokens
- the service tokens.
MslException
- if a service token is master token bound to a
master token not found in the store or if a service token is
user ID token bound to a user ID token not found in the store.Set<ServiceToken> getServiceTokens(MasterToken masterToken, UserIdToken userIdToken) throws MslException
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.
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.void removeServiceTokens(String name, MasterToken masterToken, UserIdToken userIdToken) throws MslException
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.
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.void clearServiceTokens()
|
Message Security Layer (MSL) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |