public class Crypto
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Crypto.ChannelCipher
Interface for a ChannelCipher instance that may be associated with a Channel.
|
static class |
Crypto.CipherParams
A class encapsulating the client-specifiable parameters for
the cipher.
|
| 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 byte[] |
generateRandomKey() |
static byte[] |
generateRandomKey(int keyLength) |
static Crypto.ChannelCipher |
getCipher(ChannelOptions opts)
Internal; get a ChannelCipher instance based on the given ChannelOptions
|
static Crypto.CipherParams |
getDefaultParams()
Obtain a default CipherParams.
|
static Crypto.CipherParams |
getDefaultParams(byte[] key)
Obtain a default CipherParams.
|
static Crypto.CipherParams |
getDefaultParams(Crypto.CipherParams params)
Obtain default CipherParams using key and algorithm from other CipherParams object
|
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,
int keyLength) |
static java.lang.String |
getRandomMessageId() |
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 getDefaultParams(Crypto.CipherParams params)
params - 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 byte[] generateRandomKey(int keyLength)
public static byte[] generateRandomKey()
public static Crypto.ChannelCipher getCipher(ChannelOptions opts) throws AblyException
opts - AblyExceptionpublic static java.lang.String getRandomMessageId()