public final class EntrustSymmEncConfig
extends java.lang.Object
Contains all the information necessary to configure a symmetric encryption operation. This class also provides conversions to/from name (string) representation. This allows for easy display of symmetric encryption algorithm configuration information.
A symmetric encryption algorithm configuration contains all of the following information:
The following symmetric encryption algorithm configurations are currently supported:
| Symmetric Encryption Algorithm Configurations | ||
| Symmetric Encryption Algorithm Configuration | Name | Aliases |
AES_CBC_128 |
AES-CBC-128 | AES-128 |
AES_CBC_192 |
AES-CBC-192 | AES-192 |
AES_CBC_256 |
AES-CBC-256 | AES-256, AES |
AES_GCM_128 |
AES-GCM-128 | |
AES_GCM_192 |
AES-GCM-192 | |
AES_GCM_256 |
AES-GCM-256 | |
CAST5_CBC_80 |
CAST5-CBC-80 | CAST5-80 |
CAST5_CBC_128 |
CAST5-CBC-128 | CAST5-128 |
DES_CBC_64 |
DES-CBC-64 | DES |
TRIPLEDES_CBC_192 |
TRIPLEDES-CBC-192 | TRIPLEDES |
| Modifier and Type | Field and Description |
|---|---|
static EntrustSymmEncConfig |
AES_CBC_128
Identifies the "AES-CBC-128" encryption algorithm configuration.
|
static EntrustSymmEncConfig |
AES_CBC_192
Identifies the "AES-CBC-192" encryption algorithm configuration.
|
static EntrustSymmEncConfig |
AES_CBC_256
Identifies the "AES-CBC-256" encryption algorithm configuration.
|
static EntrustSymmEncConfig |
AES_GCM_128
Identifies the "AES-GCM-128" encryption algorithm configuration.
|
static EntrustSymmEncConfig |
AES_GCM_192
Identifies the "AES-GCM-192" encryption algorithm configuration.
|
static EntrustSymmEncConfig |
AES_GCM_256
Identifies the "AES-GCM-256" encryption algorithm configuration.
|
static EntrustSymmEncConfig |
CAST5_CBC_128
Identifies the "CAST5-CBC-128" encryption algorithm configuration.
|
static EntrustSymmEncConfig |
CAST5_CBC_80
Identifies the "CAST5-CBC-80" encryption algorithm configuration.
|
static EntrustSymmEncConfig |
DES_CBC_64
Identifies the "DES-CBC" encryption algorithm configuration.
|
static EntrustSymmEncConfig |
TRIPLEDES_CBC_192
Identifies the "TRIPLEDES-CBC-192" encryption algorithm configuration.
|
| Modifier and Type | Method and Description |
|---|---|
ObjectID |
getAlgorithmOid()
Gets the symmetric encryption algorithm object identifier associated with
this symmetric encryption algorithm configuration.
|
java.security.spec.AlgorithmParameterSpec |
getAlgorithmParams()
Gets the algorithm parameters associated with this symmetric encryption
algorithm configuration.
|
int |
getBitsOfSecurity()
Gets the bits of security assigned to this symmetric encryption algorithm
configuration.
|
static EntrustSymmEncConfig |
getInstance(AlgorithmID symmEncAlgorithmId,
int keyLengthBits)
Determines the symmetric encryption algorithm configuration by examining
the algorithm object identifier and length of the key being used in a
symmetric encryption/decryption operation.
|
static EntrustSymmEncConfig |
getInstance(java.lang.String name)
Parses a symmetric encryption algorithm configuration from string name
representation.
|
int |
getKeyLengthBits()
Gets the key length (in bits) of the symmetric key associated with this
symmetric encryption algorithm configuration.
|
java.lang.String |
getName()
Gets the name of this symmetric encryption algorithm configuration.
|
static java.lang.String |
getSymmEncConfigString(AlgorithmID symmEncAlgorithmId,
int keyLengthBits)
Returns a string representation of the symmetric encryption algorithm
configuration identified by the provided algorithm identifier and key
length.
|
boolean |
isAllowed()
Determines whether or not use of the symmetric encryption algorithm
configuration is permitted by the J2SE's jurisdiction policy files.
|
java.lang.String |
toString()
Returns the string representation of this object which is the name of
this symmetric encryption algorithm configuration.
|
public static final EntrustSymmEncConfig AES_CBC_128
public static final EntrustSymmEncConfig AES_CBC_192
public static final EntrustSymmEncConfig AES_CBC_256
public static final EntrustSymmEncConfig AES_GCM_128
GCMParameterSpec (with
parameter values: IV length = 12, AT length = 16)public static final EntrustSymmEncConfig AES_GCM_192
GCMParameterSpec (with
parameter values: IV length = 12, AT length = 16)public static final EntrustSymmEncConfig AES_GCM_256
GCMParameterSpec (with
parameter values: IV length = 12, AT length = 16)public static final EntrustSymmEncConfig CAST5_CBC_80
public static final EntrustSymmEncConfig CAST5_CBC_128
public static final EntrustSymmEncConfig DES_CBC_64
public static final EntrustSymmEncConfig TRIPLEDES_CBC_192
public static EntrustSymmEncConfig getInstance(java.lang.String name)
All algorithms listed in the class documentation of
EntrustSymmEncConfig are supported by this API.
name - name of the symmetric encryption algorithm configurationjava.lang.IllegalArgumentException - if the provided name is invalid (invalid string name or alias
for a symmetric encryption algorithm configuration)public static EntrustSymmEncConfig getInstance(AlgorithmID symmEncAlgorithmId, int keyLengthBits)
All algorithms listed in the class documentation of
EntrustSymmEncConfig are supported by this API.
This API is useful when decrypting an encrypted value. At decryption time only an algorithm identifier and symmetric key are normally available (i.e. a symmetric encryption algorithm configuration name is not encoded in an encrypted value structure). This allows the recipient to determine the symmetric encryption algorithm configuration being used simply by examining an encrypted value structure.
Note: The key length is only used when the algorithm object identifier does not indicate the key length (e.g. the CAST5-CBC object identifier does not indicate a key length); otherwise the key length is ignored.
symmEncAlgorithmId - the algorithm identifier of the symmetric encryption algorithm
configurationkeyLengthBits - the length of the symmetric key in bitsjava.lang.IllegalArgumentException - if the algorithm identifier and key do not correspond to a
supported symmetric encryption algorithm configurationpublic static java.lang.String getSymmEncConfigString(AlgorithmID symmEncAlgorithmId, int keyLengthBits)
The string representation is the symmetric encryption algorithm
configuration name for supported symmetric encryption algorithms (see
getName()) or the string 'UNSUPPORTED (oid), x-bit' for
unsupported symmetric encryption algorithms (where 'oid' is the object
identifier from the algorithm identifier, and 'x' is the key size).
All symmetric encryption algorithm configurations supported by the
getInstance(AlgorithmID, int) are also supported by this API.
This API was designed for use in exception messages and log messages.
symmEncAlgorithmId - the algorithm identifier of the symmetric encryption algorithm
configurationkeyLengthBits - the length of the symmetric key in bitspublic java.lang.String getName()
public ObjectID getAlgorithmOid()
public int getKeyLengthBits()
public java.security.spec.AlgorithmParameterSpec getAlgorithmParams()
Algorithm parameters are optional; some symmetric encryption algorithm configurations will not contain algorithm parameters
null if there are no
algorithm parameterspublic int getBitsOfSecurity()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean isAllowed()
true if use of the algorithm is permitted;
false otherwiseEntrustProviderMissingException - if the Entrust CSP has not been installedEntrustProviderTamperedException - if the Entrust CSP has been tampered