public class Crypto
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Crypto.ChannelCipher
Deprecated.
Since version 1.2.11, this interface (which was only ever intended for internal use within this
library) has been replaced by
Crypto.ChannelCipherSet. It will be removed in the future. |
static interface |
Crypto.ChannelCipherSet
Internal; a matching encipher and decipher pair, where both are guaranteed to have been configured with the same
Crypto.CipherParams as each other. |
static class |
Crypto.CipherParams
A class encapsulating the client-specifiable parameters for
the cipher.
|
static interface |
Crypto.DecryptingChannelCipher
Internal; a cipher used to decrypt plaintext from ciphertext, for a channel.
|
static interface |
Crypto.EncryptingChannelCipher
Internal; a cipher used to encrypt plaintext to ciphertext, for a channel.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_ALGORITHM |
static int |
DEFAULT_BLOCKLENGTH |
static int |
DEFAULT_KEYLENGTH |
| Constructor and Description |
|---|
Crypto() |
| Modifier and Type | Method and Description |
|---|---|
static Crypto.ChannelCipherSet |
createChannelCipherSet(java.lang.Object cipherParams)
Internal; get an encrypting cipher instance based on the given channel options.
|
static byte[] |
generateRandomKey() |
static byte[] |
generateRandomKey(int keyLength) |
static Param |
generateRandomRequestId()
Returns a "request_id" query param, based on a sequence of 9 random bytes
which have been base64 encoded.
|
static Crypto.CipherParams |
getDefaultParams()
Obtain a default CipherParams.
|
static Crypto.CipherParams |
getDefaultParams(byte[] key)
Obtain a default CipherParams.
|
static Crypto.CipherParams |
getDefaultParams(java.lang.String base64Key)
Obtain a default CipherParams using Base64-encoded key.
|
static Crypto.CipherParams |
getParams(java.lang.String algorithm,
byte[] key) |
static Crypto.CipherParams |
getParams(java.lang.String algorithm,
byte[] key,
byte[] iv) |
static Crypto.CipherParams |
getParams(java.lang.String algorithm,
int keyLength) |
static java.lang.String |
getRandomId() |
public static final java.lang.String DEFAULT_ALGORITHM
public static final int DEFAULT_KEYLENGTH
public static final int DEFAULT_BLOCKLENGTH
public static Crypto.CipherParams getDefaultParams()
public static Crypto.CipherParams getDefaultParams(byte[] key)
public static Crypto.CipherParams getDefaultParams(java.lang.String base64Key)
base64Key - public static Crypto.CipherParams getParams(java.lang.String algorithm, int keyLength)
public static Crypto.CipherParams getParams(java.lang.String algorithm, byte[] key) throws java.security.NoSuchAlgorithmException
java.security.NoSuchAlgorithmExceptionpublic static Crypto.CipherParams getParams(java.lang.String algorithm, byte[] key, byte[] iv) throws java.security.NoSuchAlgorithmException
java.security.NoSuchAlgorithmExceptionpublic static byte[] generateRandomKey(int keyLength)
public static byte[] generateRandomKey()
public static Crypto.ChannelCipherSet createChannelCipherSet(java.lang.Object cipherParams) throws AblyException
AblyExceptionpublic static java.lang.String getRandomId()
public static Param generateRandomRequestId()