Message Security Layer (MSL)

com.netflix.msl.keyx
Class JsonWebKeyLadderExchange.JwkCryptoContext

java.lang.Object
  extended by com.netflix.msl.keyx.JsonWebKeyLadderExchange.JwkCryptoContext
All Implemented Interfaces:
ICryptoContext
Direct Known Subclasses:
JsonWebKeyLadderExchange.AesKwJwkCryptoContext
Enclosing class:
JsonWebKeyLadderExchange

public abstract static class JsonWebKeyLadderExchange.JwkCryptoContext
extends Object
implements ICryptoContext

A specialized crypto context for wrapping and unwrapping JSON web keys.

Implementations of this class must add and remove padding to the JSON web key string representation's binary encoding for compatibility with the wrapping algorithm used.


Constructor Summary
JsonWebKeyLadderExchange.JwkCryptoContext()
           
 
Method Summary
 byte[] decrypt(byte[] data)
          Decrypts some data.
 byte[] encrypt(byte[] data)
          Encrypts some data.
 byte[] sign(byte[] data)
          Computes the signature for some data.
 boolean verify(byte[] data, byte[] signature)
          Verifies the signature for some data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.netflix.msl.crypto.ICryptoContext
unwrap, wrap
 

Constructor Detail

JsonWebKeyLadderExchange.JwkCryptoContext

public JsonWebKeyLadderExchange.JwkCryptoContext()
Method Detail

encrypt

public byte[] encrypt(byte[] data)
               throws MslCryptoException
Description copied from interface: ICryptoContext
Encrypts some data.

Specified by:
encrypt in interface ICryptoContext
Parameters:
data - the plaintext.
Returns:
the ciphertext.
Throws:
MslCryptoException - if there is an error encrypting the data.

decrypt

public byte[] decrypt(byte[] data)
               throws MslCryptoException
Description copied from interface: ICryptoContext
Decrypts some data.

Specified by:
decrypt in interface ICryptoContext
Parameters:
data - the ciphertext.
Returns:
the plaintext.
Throws:
MslCryptoException - if there is an error decrypting the data.

sign

public byte[] sign(byte[] data)
            throws MslCryptoException
Description copied from interface: ICryptoContext
Computes the signature for some data. The signature may not be a signature proper, but the name suits the concept.

Specified by:
sign in interface ICryptoContext
Parameters:
data - the data.
Returns:
the signature.
Throws:
MslCryptoException - if there is an error computing the signature.

verify

public boolean verify(byte[] data,
                      byte[] signature)
               throws MslCryptoException
Description copied from interface: ICryptoContext
Verifies the signature for some data. The signature may not be a signature proper, but the name suits the concept.

Specified by:
verify in interface ICryptoContext
Parameters:
data - the data.
signature - the signature.
Returns:
true if the data is verified, false if validation fails.
Throws:
MslCryptoException - if there is an error verifying the signature.

Message Security Layer (MSL)

Copyright © 2014 Netflix, Inc. All Rights Reserved.