Message Security Layer (MSL)

com.netflix.msl.crypto
Interface ICryptoContext


public interface ICryptoContext

A generic cryptographic context suitable for encryption/decryption, wrap/unwrap, and sign/verify operations.


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.
 byte[] unwrap(byte[] data)
          Unwraps some data.
 boolean verify(byte[] data, byte[] signature)
          Verifies the signature for some data.
 byte[] wrap(byte[] data)
          Wraps some data.
 

Method Detail

encrypt

byte[] encrypt(byte[] data)
               throws MslCryptoException
Encrypts some data.

Parameters:
data - the plaintext.
Returns:
the ciphertext.
Throws:
MslCryptoException - if there is an error encrypting the data.

decrypt

byte[] decrypt(byte[] data)
               throws MslCryptoException
Decrypts some data.

Parameters:
data - the ciphertext.
Returns:
the plaintext.
Throws:
MslCryptoException - if there is an error decrypting the data.

wrap

byte[] wrap(byte[] data)
            throws MslCryptoException
Wraps some data.

Parameters:
data - the plaintext.
Returns:
the wrapped data.
Throws:
MslCryptoException - if there is an error wrapping the data.

unwrap

byte[] unwrap(byte[] data)
              throws MslCryptoException
Unwraps some data.

Parameters:
data - the wrapped data.
Returns:
the plaintext.
Throws:
MslCryptoException - if there is an error unwrapping the data.

sign

byte[] sign(byte[] data)
            throws MslCryptoException
Computes the signature for some data. The signature may not be a signature proper, but the name suits the concept.

Parameters:
data - the data.
Returns:
the signature.
Throws:
MslCryptoException - if there is an error computing the signature.

verify

boolean verify(byte[] data,
               byte[] signature)
               throws MslCryptoException
Verifies the signature for some data. The signature may not be a signature proper, but the name suits the concept.

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.