|
Message Security Layer (MSL) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.netflix.msl.keyx.KeyExchangeFactory
com.netflix.msl.keyx.AsymmetricWrappedExchange
public class AsymmetricWrappedExchange
Asymmetric key wrapped key exchange.
Nested Class Summary | |
---|---|
private static class |
AsymmetricWrappedExchange.JwkRsaCryptoContext
A JWK RSA crypto context is unique in that it treats its wrap/unwrap operations as encrypt/decrypt respectively. |
static class |
AsymmetricWrappedExchange.RequestData
Asymmetric key wrapped key request data. |
static class |
AsymmetricWrappedExchange.ResponseData
Asymmetric key wrapped key response data. |
Nested classes/interfaces inherited from class com.netflix.msl.keyx.KeyExchangeFactory |
---|
KeyExchangeFactory.KeyExchangeData |
Field Summary | |
---|---|
private AuthenticationUtils |
authutils
Authentication utilities. |
private static Set<JsonWebKey.KeyOp> |
ENCRYPT_DECRYPT
Encrypt/decrypt key operations. |
private static Set<JsonWebKey.KeyOp> |
SIGN_VERIFY
Sign/verify key operations. |
Constructor Summary | |
---|---|
AsymmetricWrappedExchange(AuthenticationUtils authutils)
Create a new asymmetric wrapped key exchange factory. |
Method Summary | |
---|---|
private static ICryptoContext |
createCryptoContext(MslContext ctx,
String keyPairId,
AsymmetricWrappedExchange.RequestData.Mechanism mechanism,
PrivateKey privateKey,
PublicKey publicKey)
Create the crypto context identified by the key ID, mechanism, and provided keys. |
(package private) KeyRequestData |
createRequestData(MslContext ctx,
JSONObject keyRequestJO)
Construct a new key request data instance from the provided JSON. |
(package private) KeyResponseData |
createResponseData(MslContext ctx,
MasterToken masterToken,
JSONObject keyDataJO)
Construct a new key response data instance from the provided JSON. |
KeyExchangeFactory.KeyExchangeData |
generateResponse(MslContext ctx,
KeyRequestData keyRequestData,
MasterToken masterToken)
Generate a new key response data instance and crypto context in response to the provided key request data. |
KeyExchangeFactory.KeyExchangeData |
generateResponse(MslContext ctx,
KeyRequestData keyRequestData,
String identity)
Generate a new key response data instance and crypto context in response to the provided key request data and entity identity. |
ICryptoContext |
getCryptoContext(MslContext ctx,
KeyRequestData keyRequestData,
KeyResponseData keyResponseData,
MasterToken masterToken)
Create a crypto context from the provided key request data and key response data. |
Methods inherited from class com.netflix.msl.keyx.KeyExchangeFactory |
---|
getScheme |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final Set<JsonWebKey.KeyOp> ENCRYPT_DECRYPT
private static final Set<JsonWebKey.KeyOp> SIGN_VERIFY
private final AuthenticationUtils authutils
Constructor Detail |
---|
public AsymmetricWrappedExchange(AuthenticationUtils authutils)
Method Detail |
---|
private static ICryptoContext createCryptoContext(MslContext ctx, String keyPairId, AsymmetricWrappedExchange.RequestData.Mechanism mechanism, PrivateKey privateKey, PublicKey publicKey) throws MslCryptoException
ctx
- MSL context.keyPairId
- the key pair ID.mechanism
- the key mechanism.privateKey
- the private key. May be null.publicKey
- the public key. May be null.
MslCryptoException
- if the key mechanism is unsupported.KeyRequestData createRequestData(MslContext ctx, JSONObject keyRequestJO) throws MslEncodingException, MslCryptoException, MslKeyExchangeException
KeyExchangeFactory
createRequestData
in class KeyExchangeFactory
ctx
- MSL context.keyRequestJO
- the JSON object.
MslEncodingException
- if there is an error parsing the JSON.
MslCryptoException
- if the keying material cannot be created.
MslKeyExchangeException
- if there is an error creating the key
request data.KeyResponseData createResponseData(MslContext ctx, MasterToken masterToken, JSONObject keyDataJO) throws MslEncodingException, MslKeyExchangeException
KeyExchangeFactory
createResponseData
in class KeyExchangeFactory
ctx
- MSL context.masterToken
- the master token for the new key response data.keyDataJO
- the JSON object.
MslEncodingException
- if there is an error parsing the JSON.
MslKeyExchangeException
- if there is an error creating the key
response data.public KeyExchangeFactory.KeyExchangeData generateResponse(MslContext ctx, KeyRequestData keyRequestData, MasterToken masterToken) throws MslKeyExchangeException, MslCryptoException, MslMasterTokenException, MslEncodingException, MslException
KeyExchangeFactory
Generate a new key response data instance and crypto context in response to the provided key request data. The key request data will be from the the remote entity.
The provided master token should be renewed by incrementing its sequence number but maintaining its serial number by using the MSL context's token factory.
generateResponse
in class KeyExchangeFactory
ctx
- MSL context.keyRequestData
- the key request data.masterToken
- the master token to renew.
MslKeyExchangeException
- if there is an error with the key
request data or the key response data cannot be created.
MslCryptoException
- if the crypto context cannot be created.
MslMasterTokenException
- if the master token is not trusted and
needs to be.
MslEncodingException
- if there is an error parsing or encoding
the JSON.
MslEntityAuthException
- if there is a problem with the master
token identity.
MslException
- if there is an error renewing the master token.public KeyExchangeFactory.KeyExchangeData generateResponse(MslContext ctx, KeyRequestData keyRequestData, String identity) throws MslException
KeyExchangeFactory
Generate a new key response data instance and crypto context in response to the provided key request data and entity identity. The key request data will be from the the remote entity.
generateResponse
in class KeyExchangeFactory
ctx
- MSL context.keyRequestData
- the key request data.identity
- the entity identity.
MslKeyExchangeException
- if there is an error with the key
request data or the key response data cannot be created.
MslCryptoException
- if the crypto context cannot be created.
MslEncodingException
- if there is an error parsing or encoding
the JSON.
MslEntityAuthException
- if there is a problem with the entity
identity.
MslException
- if there is an error creating the master token.public ICryptoContext getCryptoContext(MslContext ctx, KeyRequestData keyRequestData, KeyResponseData keyResponseData, MasterToken masterToken) throws MslKeyExchangeException, MslCryptoException, MslEncodingException
KeyExchangeFactory
getCryptoContext
in class KeyExchangeFactory
ctx
- MSL context.keyRequestData
- the key request data.keyResponseData
- the key response data.masterToken
- the current master token (not the one inside the key
response data). May be null.
MslKeyExchangeException
- if there is an error with the key
request data or key response data.
MslCryptoException
- if the crypto context cannot be created.
MslEncodingException
- if there is an error parsing the JSON.
|
Message Security Layer (MSL) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |