|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.security12.sun.security.x509.AlgorithmId
This class identifies algorithms, such as cryptographic transforms, each of which may be associated with parameters. Instances of this base class are used when this runtime environment has no special knowledge of the algorithm type, and may also be used in other cases. Equivalence is defined according to OID and (where relevant) parameters.
Subclasses may be used, for example when when the algorithm ID has associated parameters which some code (e.g. code using public keys) needs to have parsed. Two examples of such algorithms are Diffie-Hellman key exchange, and the Digital Signature Standard Algorithm (DSS/DSA).
The OID constants defined in this class correspond to some widely used algorithms, for which conventional string names have been defined. This class is not a general repository for OIDs, or for such string names. Note that the mappings between algorithm IDs and algorithm names is not one-to-one.
Field Summary | |
static ObjectIdentifier |
DH_oid
Algorithm ID for Diffie Hellman Key agreement, from PKCS #3. |
static ObjectIdentifier |
DH_PKIX_oid
Algorithm ID for the Diffie Hellman Key Agreement (DH), from the IETF PKIX IPKI Part I. |
static ObjectIdentifier |
DSA_oid
Algorithm ID for the Digital Signing Algorithm (DSA), from the IETF PKIX IPKI Part I. |
static ObjectIdentifier |
DSA_OIW_oid
Algorithm ID for the Digital Signing Algorithm (DSA), from the NIST OIW Stable Agreements part 12. |
static ObjectIdentifier |
MD2_oid
Algorithm ID for the MD2 Message Digest Algorthm, from RFC 1319. |
static ObjectIdentifier |
md2WithRSAEncryption_oid
Identifies a signing algorithm where an MD2 digest is encrypted using an RSA private key; defined in PKCS #1. |
static ObjectIdentifier |
MD5_oid
Algorithm ID for the MD5 Message Digest Algorthm, from RFC 1321. |
static ObjectIdentifier |
md5WithRSAEncryption_oid
Identifies a signing algorithm where an MD5 digest is encrypted using an RSA private key; defined in PKCS #1. |
protected DerValue |
params
Parameters for this algorithm. |
static ObjectIdentifier |
RSA_oid
Algorithm ID for RSA keys used for any purpose, as defined in X.509. |
static ObjectIdentifier |
RSAEncryption_oid
Algorithm ID for RSA keys used with RSA encryption, as defined in PKCS #1. |
static ObjectIdentifier |
SHA_oid
Algorithm ID for the SHA1 Message Digest Algorithm, from FIPS 180-1. |
static ObjectIdentifier |
sha1WithDSA_oid
Identifies the FIPS 186 "Digital Signature Standard" (DSS), where a SHA1 digest is signed using the Digital Signing Algorithm (DSA). |
static ObjectIdentifier |
sha1WithDSA_OIW_oid
Identifies the FIPS 186 "Digital Signature Standard" (DSS), where a SHA1 digest is signed using the Digital Signing Algorithm (DSA). |
static ObjectIdentifier |
sha1WithRSAEncryption_oid
Identifies a signing algorithm where a SHA1 digest is encrypted using an RSA private key; defined by RSA DSI. |
static ObjectIdentifier |
sha1WithRSAEncryption_OIW_oid
Identifies a signing algorithm where a SHA1 digest is encrypted using an RSA private key; defined in NIST OIW. |
static ObjectIdentifier |
shaWithDSA_OIW_oid
Identifies the FIPS 186 "Digital Signature Standard" (DSS), where a SHA digest is signed using the Digital Signing Algorithm (DSA). |
Constructor Summary | |
AlgorithmId()
Deprecated. use one of the other constructors. |
|
AlgorithmId(ObjectIdentifier oid)
Constructs a parameterless algorithm ID. |
Method Summary | |
protected void |
decodeParams()
|
void |
derEncode(OutputStream out)
DER encode this object onto an output stream. |
byte[] |
encode()
Returns the DER-encoded X.509 AlgorithmId as a byte array. |
void |
encode(DerOutputStream out)
Marshal a DER-encoded "AlgorithmID" sequence on the DER stream. |
boolean |
equals(AlgorithmId other)
Returns true iff the argument indicates the same algorithm with the same parameters. |
boolean |
equals(Object other)
Compares this AlgorithmID to another. |
boolean |
equals(ObjectIdentifier id)
Compares two algorithm IDs for equality. |
static AlgorithmId |
get(String algname)
Returns one of the algorithm IDs most commonly associated with this algorithm name. |
static AlgorithmId |
getAlgorithmId(String algname)
Deprecated. use the short get form of this method. |
byte[] |
getEncodedParams()
Returns the DER encoded parameter, which can then be used to initialize com.ibm.security12.java.security.AlgorithmParamters. |
String |
getName()
Returns a name for the algorithm which may be more intelligible to humans than the algorithm's OID, but which won't necessarily be comprehensible on other systems. |
ObjectIdentifier |
getOID()
Returns the ISO OID for this algorithm. |
AlgorithmParameters |
getParameters()
|
protected String |
paramsToString()
Provides a human-readable description of the algorithm parameters. |
static AlgorithmId |
parse(DerValue val)
Parse (unmarshal) an ID from a DER sequence input value. |
String |
toString()
Returns a string describing the algorithm and its parameters. |
Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected DerValue params
public static final ObjectIdentifier MD2_oid
public static final ObjectIdentifier MD5_oid
public static final ObjectIdentifier SHA_oid
public static final ObjectIdentifier DH_oid
public static final ObjectIdentifier DH_PKIX_oid
public static final ObjectIdentifier DSA_OIW_oid
public static final ObjectIdentifier DSA_oid
public static final ObjectIdentifier RSA_oid
public static final ObjectIdentifier RSAEncryption_oid
public static final ObjectIdentifier md2WithRSAEncryption_oid
public static final ObjectIdentifier md5WithRSAEncryption_oid
public static final ObjectIdentifier sha1WithRSAEncryption_oid
public static final ObjectIdentifier sha1WithRSAEncryption_OIW_oid
public static final ObjectIdentifier shaWithDSA_OIW_oid
public static final ObjectIdentifier sha1WithDSA_OIW_oid
public static final ObjectIdentifier sha1WithDSA_oid
Constructor Detail |
public AlgorithmId(ObjectIdentifier oid)
oid
- the identifier for the algorithmpublic AlgorithmId()
Method Detail |
public static AlgorithmId getAlgorithmId(String algname) throws NoSuchAlgorithmException
algname
- the name being usedpublic AlgorithmParameters getParameters()
public static AlgorithmId get(String algname) throws NoSuchAlgorithmException
algname
- the name being usedpublic static AlgorithmId parse(DerValue val) throws IOException
val
- the input value, which contains the algid and, if
there are any parameters, those parameters.protected void decodeParams() throws IOException
public final void encode(DerOutputStream out) throws IOException
public void derEncode(OutputStream out) throws IOException
DerEncoder
interface.out
- the output stream on which to write the DER encoding.public final byte[] encode() throws IOException
public final ObjectIdentifier getOID()
getName
call when you do not need to ensure cross-system portability
of algorithm names, or need a user friendly name.public String getName()
public String toString()
public byte[] getEncodedParams() throws IOException
protected String paramsToString()
public boolean equals(AlgorithmId other)
public boolean equals(Object other)
other
- preferably an AlgorithmId, else an ObjectIdentifierpublic final boolean equals(ObjectIdentifier id)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |