|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--codec.util.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. |
| 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. |
static String |
resolveAlias(String engine,
String alias)
Resolves the given alias to the standard JCA name for the given engine type. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static Map aliases_
| Method Detail |
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.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: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||