|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcodec.util.JCA
public class JCA
A number of invariants must hold for the properties defined by the installed providers such that this class can work properly:
| Field Summary | |
|---|---|
protected static Map |
aliases_
The root alias map. |
private static Map |
dc2s_
The digest/cipher name to signature algorithm name mapping. |
protected static Provider[] |
providers_
The current list of installed providers. |
private static Map |
s2dc_
The signature algorithm name to digest/cipher name mapping. |
| Constructor Summary | |
|---|---|
private |
JCA()
Let no-one create an instance. |
| Method Summary | |
|---|---|
static String |
getCipherOID(String sigAlg)
This method maps the given standard signature algorithm name to the string representation of the OID associated with the cipher algorithm of the given signature algorithm. |
static String |
getDigestOID(String sigAlg)
This method maps the given standard signature algorithm name to the string representation of the OID associated with the digest algorithm of the given signature algorithm. |
static String |
getName(String oid)
Returns the JCA standard name for a given OID. |
static String |
getOID(String algorithm)
Returns the OID of the given algorithm name. |
static String |
getOID(String algorithm,
String engine)
Returns the OID of the given algorithm name. |
static String |
getSignatureName(String doid,
String coid)
This method maps a given digest algorithm OID and cipher algorithm OID onto the standard name of the combined signature algorithm. |
static String |
getSlashedForm(String sigAlg)
This method maps the standard signature algorithm name to the digestAlg/cipherAlg format. |
private static Map |
initAliasLookup()
Reads the properties of the installed providers and builds an optimized alias lookup table. |
static String |
resolveAlias(String engine,
String alias)
Resolves the given alias to the standard JCA name for the given engine type. |
private static void |
updateAliases()
Re-builds the optimized alias lookup table by calling initAliasLookup(), in case the list of
installed providers had been changed dynamically. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static Map dc2s_
private static Map s2dc_
protected static Map aliases_
protected static Provider[] providers_
| Constructor Detail |
|---|
private JCA()
| Method Detail |
|---|
private static Map initAliasLookup()
private static void updateAliases()
initAliasLookup(), in case the list of
installed providers had been changed dynamically.
public static String getName(String oid)
null is returned.OID mappings are unambigous; no engine type is required for the mapping and no engine type is returned as part of the result. The returned string consists only of the name of the algorithm.
oid - The string with the OID that shall be resolved.
null if no such OID is defined.
NullPointerException - if the oid is
null.
public static String resolveAlias(String engine,
String alias)
null is returned. If the given alias is
actually an OID string and there is an appropriate alias
mapping defined for that OID by some provider then the
corresponding JCA name is returned.
engine - The JCA engine type name.alias - The alias to resolve for the given engine type.
null if no
appropriate mapping could be found.
IllegalArgumentException - if the alias is
an empty string.
NullPointerException - if the alias or engine
name is null.public static String getOID(String algorithm)
resolveAlias to map aliases
onto their standard names.
algorithm - The JCA standard name of the algorithm
for which the OID should be returned.
null if no appropriate
mapping could be found.
NullPointerException - if engine or algorithm is
null.
public static String getOID(String algorithm,
String engine)
resolveAlias
method.
algorithm - The JCA standard name of the algorithm
for which the OID should be returned.engine - The engine name that is taken as a hint
for alias resolving if the algorithm name cannot be
resolved in the first attempt.
null if no appropriate
mapping could be found.
NullPointerException - if engine or algorithm is
null.
public static String getSignatureName(String doid,
String coid)
All found mappings are cached for future use, as well as the reverse mapping, which is much more complicated to synthesise.
doid - The string representation of the digest
algorithm OID. The OID must have a "OID."
prefix.doid - The string representation of the cipher
algorithm OID. The OID must have a "OID."
prefix.
null if no mapping could be found.public static String getSlashedForm(String sigAlg)
sigAlg contains a "/" then
we assume that the given algorithm name is already
of the desired form and return sigAlg.
sigAlg - The standard signature algorithm name.
null if no suitable mapping could be found.public static String getDigestOID(String sigAlg)
sigAlg - The standard signature algorithm name.
sigAlg.public static String getCipherOID(String sigAlg)
This conversion is a bit tricky. In cases such as DSA, no corresponding Cipher engine exists, since DSA is not designed to be used as a cipher. In such cases, some provider needs to set up a bogus alias of the form:
sigAlg - The standard signature algorithm name.
sigAlg.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||