Subclasses may be used, for example 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.
Modifier and Type | Field and Description |
---|---|
private ObjectIdentifier | algid
The object identifier being used for this algorithm. |
private AlgorithmParameters | |
private static volatile Map | |
public static final ObjectIdentifier | |
public static final ObjectIdentifier | |
protected transient byte[] | encodedParams
Parameters for this algorithm. |
public static final ObjectIdentifier | |
public static final ObjectIdentifier | |
public static final ObjectIdentifier | |
public static final ObjectIdentifier | |
public static final ObjectIdentifier | |
public static final ObjectIdentifier | |
public static final ObjectIdentifier | |
private static final long | serialVersionUID
use serialVersionUID from JDK 1.1. |
public static final ObjectIdentifier | |
public static final ObjectIdentifier | |
public static final ObjectIdentifier | |
public static final ObjectIdentifier | |
public static final ObjectIdentifier | |
public static final ObjectIdentifier | |
public static final ObjectIdentifier | |
public static final ObjectIdentifier | |
public static final ObjectIdentifier | |
public static final ObjectIdentifier | |
public static final ObjectIdentifier | |
public static final ObjectIdentifier | |
public static final ObjectIdentifier | |
public static final ObjectIdentifier | |
public static final ObjectIdentifier | |
public static final ObjectIdentifier | |
public static final ObjectIdentifier | |
public static final ObjectIdentifier | |
public static final ObjectIdentifier | |
public static final ObjectIdentifier | |
public static final ObjectIdentifier | |
public static final ObjectIdentifier |
Access | Constructor and Description |
---|---|
public | AlgorithmId()
Deprecated
use one of the other constructors.
Constructs an algorithm ID which will be initialized separately, for example by deserialization. |
public | AlgorithmId(ObjectIdentifier
the identifier for the algorithm oid)Constructs a parameterless algorithm ID. |
public | AlgorithmId(ObjectIdentifier
the identifier for the algorithm. oid, AlgorithmParameters the associated algorithm parameters, can be null. algparams)Constructs an algorithm ID with algorithm parameters. |
public | AlgorithmId(ObjectIdentifier
the identifier for the algorithm. oid, DerValue the associated algorithm parameters, can be null. params)Constructs an algorithm ID with algorithm parameters as a DerValue. |
Modifier and Type | Method and Description |
---|---|
private static ObjectIdentifier | |
private static Map | |
public static void | |
private static ConcurrentHashMap | |
protected void | |
public void | encode(DerOutputStream
the output stream on which to write the DER encoding. out)Implements sun. DER encode this object onto an output stream. |
public final byte[] | |
public boolean | equals(AlgorithmId other)
Returns true iff the argument indicates the same algorithm with the same parameters. |
public boolean | equals(Object
preferably an AlgorithmId, else an ObjectIdentifier other)Overrides java. Compares this AlgorithmID to another. |
public final boolean | |
public static AlgorithmId | |
public static AlgorithmId | get(AlgorithmParameters
the associated algorithm parameters. algparams)Returns one of the algorithm IDs most commonly associated with this algorithm parameters. |
public static AlgorithmId | getAlgorithmId(String
the name being used algname)
Deprecated
use the short get form of this method.
Returns one of the algorithm IDs most commonly associated with this algorithm name. |
public byte[] | Returns: DER encoded parameters, or null not present.Returns the DER encoded parameter, which can then be used to initialize java.security.AlgorithmParameters. |
public String | getName()
Returns a name for the algorithm which can be used by getInstance() call of a crypto primitive. |
public final ObjectIdentifier | |
public AlgorithmParameters | |
public int | Returns: a hashcode for this AlgorithmIdOverrides java. Returns a hashcode for this AlgorithmId. |
private static boolean | |
protected String | |
public static AlgorithmId | Returns: an ID for the algorithm. If the system is configured appropriately, this may be an instance of a class with some kind of special support for this algorithm. In that case, you may "narrow" the type of the ID.the input value, which contains the algid and, if
there are any parameters, those parameters. val)Parse (unmarshal) an ID from a DER sequence input value. |
public String | toString()
Overrides java. Returns a string describing the algorithm and its parameters. |
algid | back to summary |
---|---|
private ObjectIdentifier algid The object identifier being used for this algorithm. |
algParams | back to summary |
---|---|
private AlgorithmParameters algParams
|
aliasOidsTable | back to summary |
---|---|
private static volatile Map<String, String> aliasOidsTable |
DSA_oid | back to summary |
---|---|
public static final ObjectIdentifier DSA_oid |
EC_oid | back to summary |
---|---|
public static final ObjectIdentifier EC_oid |
encodedParams | back to summary |
---|---|
protected transient byte[] encodedParams Parameters for this algorithm. These are stored in unparsed DER-encoded form; subclasses can be made to automatically parse them so there is fast access to these parameters. |
MD2_oid | back to summary |
---|---|
public static final ObjectIdentifier MD2_oid |
MD2withRSA_oid | back to summary |
---|---|
public static final ObjectIdentifier MD2withRSA_oid |
MD5_oid | back to summary |
---|---|
public static final ObjectIdentifier MD5_oid |
MD5withRSA_oid | back to summary |
---|---|
public static final ObjectIdentifier MD5withRSA_oid |
MGF1_oid | back to summary |
---|---|
public static final ObjectIdentifier MGF1_oid |
RSAEncryption_oid | back to summary |
---|---|
public static final ObjectIdentifier RSAEncryption_oid |
RSASSA_PSS_oid | back to summary |
---|---|
public static final ObjectIdentifier RSASSA_PSS_oid |
serialVersionUID | back to summary |
---|---|
private static final long serialVersionUID use serialVersionUID from JDK 1.1. for interoperability |
SHA1withRSA_oid | back to summary |
---|---|
public static final ObjectIdentifier SHA1withRSA_oid |
SHA224_oid | back to summary |
---|---|
public static final ObjectIdentifier SHA224_oid |
SHA224withRSA_oid | back to summary |
---|---|
public static final ObjectIdentifier SHA224withRSA_oid |
SHA256_oid | back to summary |
---|---|
public static final ObjectIdentifier SHA256_oid |
SHA256withRSA_oid | back to summary |
---|---|
public static final ObjectIdentifier SHA256withRSA_oid |
SHA384_oid | back to summary |
---|---|
public static final ObjectIdentifier SHA384_oid |
SHA384withRSA_oid | back to summary |
---|---|
public static final ObjectIdentifier SHA384withRSA_oid |
SHA3_224_oid | back to summary |
---|---|
public static final ObjectIdentifier SHA3_224_oid |
SHA3_224withRSA_oid | back to summary |
---|---|
public static final ObjectIdentifier SHA3_224withRSA_oid |
SHA3_256_oid | back to summary |
---|---|
public static final ObjectIdentifier SHA3_256_oid |
SHA3_256withRSA_oid | back to summary |
---|---|
public static final ObjectIdentifier SHA3_256withRSA_oid |
SHA3_384_oid | back to summary |
---|---|
public static final ObjectIdentifier SHA3_384_oid |
SHA3_384withRSA_oid | back to summary |
---|---|
public static final ObjectIdentifier SHA3_384withRSA_oid |
SHA3_512_oid | back to summary |
---|---|
public static final ObjectIdentifier SHA3_512_oid |
SHA3_512withRSA_oid | back to summary |
---|---|
public static final ObjectIdentifier SHA3_512withRSA_oid |
SHA512$224withRSA_oid | back to summary |
---|---|
public static final ObjectIdentifier SHA512$224withRSA_oid |
SHA512$256withRSA_oid | back to summary |
---|---|
public static final ObjectIdentifier SHA512$256withRSA_oid |
SHA512_224_oid | back to summary |
---|---|
public static final ObjectIdentifier SHA512_224_oid |
SHA512_256_oid | back to summary |
---|---|
public static final ObjectIdentifier SHA512_256_oid |
SHA512_oid | back to summary |
---|---|
public static final ObjectIdentifier SHA512_oid |
SHA512withRSA_oid | back to summary |
---|---|
public static final ObjectIdentifier SHA512withRSA_oid |
SHA_oid | back to summary |
---|---|
public static final ObjectIdentifier SHA_oid |
AlgorithmId | back to summary |
---|---|
public AlgorithmId()
Deprecated use one of the other constructors. Constructs an algorithm ID which will be initialized separately, for example by deserialization.
|
AlgorithmId | back to summary |
---|---|
public AlgorithmId(ObjectIdentifier oid) Constructs a parameterless algorithm ID.
|
AlgorithmId | back to summary |
---|---|
public AlgorithmId(ObjectIdentifier oid, AlgorithmParameters algparams) Constructs an algorithm ID with algorithm parameters.
|
AlgorithmId | back to summary |
---|---|
public AlgorithmId(ObjectIdentifier oid, DerValue params) throws IOException Constructs an algorithm ID with algorithm parameters as a DerValue.
|
algOID | back to summary |
---|---|
private static ObjectIdentifier algOID(String name) throws IOException |
aliasOidsTable | back to summary |
---|---|
private static Map |
clearAliasOidsTable | back to summary |
---|---|
public static void clearAliasOidsTable() |
collectOIDAliases | back to summary |
---|---|
private static ConcurrentHashMap |
decodeParams | back to summary |
---|---|
protected void decodeParams() throws IOException |
encode | back to summary |
---|---|
public void encode(DerOutputStream out) Implements sun. DER encode this object onto an output stream.
Implements the
|
encode | back to summary |
---|---|
public final byte[] encode() Returns the DER-encoded X.509 AlgorithmId as a byte array. |
equals | back to summary |
---|---|
public boolean equals(AlgorithmId other) Returns true iff the argument indicates the same algorithm with the same parameters. |
equals | back to summary |
---|---|
public boolean equals(Object other) Overrides java. Compares this AlgorithmID to another. If algorithm parameters are available, they are compared. Otherwise, just the object IDs for the algorithm are compared.
|
equals | back to summary |
---|---|
public final boolean equals(ObjectIdentifier id) Compares two algorithm IDs for equality. Returns true iff they are the same algorithm, ignoring algorithm parameters. |
get | back to summary |
---|---|
public static AlgorithmId get(String algname) throws NoSuchAlgorithmException Returns one of the algorithm IDs most commonly associated with this algorithm name.
|
get | back to summary |
---|---|
public static AlgorithmId get(AlgorithmParameters algparams) throws NoSuchAlgorithmException Returns one of the algorithm IDs most commonly associated with this algorithm parameters.
|
getAlgorithmId | back to summary |
---|---|
public static AlgorithmId getAlgorithmId(String algname) throws NoSuchAlgorithmException
Deprecated use the short get form of this method. Returns one of the algorithm IDs most commonly associated with this algorithm name.
|
getEncodedParams | back to summary |
---|---|
public byte[] getEncodedParams() Returns the DER encoded parameter, which can then be used to initialize java.security.AlgorithmParameters. Note that this* method should always return a new array as it is called directly by the JDK implementation of X509Certificate.getSigAlgParams() and X509CRL.getSigAlgParams(). Note for ecdsa-with-SHA2 plus hash algorithm (Ex: SHA-256), this method
returns null because
|
getName | back to summary |
---|---|
public String getName() Returns a name for the algorithm which can be used by getInstance() call of a crypto primitive. The name is usually more intelligible to humans than the algorithm's OID, but which won't necessarily be comprehensible on other systems. For example, this might return a name such as "MD5withRSA" for a signature algorithm on some systems. It also returns OID names like "1.2.3.4", when no particular name for the algorithm is known. The OID may also be recognized by getInstance() calls since an OID is usually defined as an alias for an algorithm by the security provider. In some special cases where the OID does not include enough info to return a Java standard algorithm name, an algorithm name that includes info on the params is returned: 1. For ecdsa-with-SHA2 plus hash algorithm (Ex: SHA-256), this method returns the "full" signature algorithm (Ex: SHA256withECDSA) directly. 2. For PBES2, this method returns the "full" cipher name containing the KDF and Enc algorithms (Ex: PBEWithHmacSHA256AndAES_256) directly. |
getOID | back to summary |
---|---|
public final ObjectIdentifier getOID() Returns the ISO OID for this algorithm. This is usually converted
to a string and used as part of an algorithm name, for example
"OID.1.3.14.3.2.13" style notation. Use the |
getParameters | back to summary |
---|---|
public AlgorithmParameters getParameters() |
hashCode | back to summary |
---|---|
public int hashCode() Overrides java. Returns a hashcode for this AlgorithmId.
|
isKnownProvider | back to summary |
---|---|
private static boolean isKnownProvider(Provider p) |
paramsToString | back to summary |
---|---|
protected String paramsToString() Provides a human-readable description of the algorithm parameters. This may be redefined by subclasses which parse those parameters. |
parse | back to summary |
---|---|
public static AlgorithmId parse(DerValue val) throws IOException Parse (unmarshal) an ID from a DER sequence input value. This form parsing might be used when expanding a value which has already been partially unmarshaled as a set or sequence member.
|
toString | back to summary |
---|---|
public String toString() Overrides java. Returns a string describing the algorithm and its parameters.
|