Package sun.security.x509
Class AlgorithmId
- java.lang.Object
-
- sun.security.x509.AlgorithmId
-
- All Implemented Interfaces:
java.io.Serializable
public class AlgorithmId extends java.lang.Object implements java.io.SerializableUse this class to get OID of supported algorithms seeget(String)The OID is handled in it's String format in this class. example 1.2.840.113549.1.1.11 for "SHA256withRSA"- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AlgorithmId()Deprecated.use one of the other constructors.AlgorithmId(java.lang.String oid)Constructs a parameterless algorithm ID.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(java.lang.Object other)Compares this AlgorithmID to another.booleanequals(java.lang.String id)Compares two algorithm IDs for equality.booleanequals(AlgorithmId other)Returns true iff the argument indicates the same algorithm with the same parameters.static AlgorithmIdget(java.lang.String algname)Returns one of the algorithm IDs most commonly associated with this algorithm name.static AlgorithmIdgetAlgorithmId(java.lang.String algname)Deprecated.use the short get form of this method.static java.lang.StringgetDigAlgFromSigAlg(java.lang.String signatureAlgorithm)Extracts the digest algorithm name from a signature algorithm name.static java.lang.StringgetEncAlgFromSigAlg(java.lang.String signatureAlgorithm)Extracts the encryption algorithm name from a signature algorithm name.java.lang.StringgetOID()Returns the ISO OID for this algorithm.inthashCode()Returns a hashcode for this AlgorithmId.static java.lang.StringmakeSigAlg(java.lang.String digAlg, java.lang.String encAlg)Creates a signature algorithm name from a digest algorithm name and a encryption algorithm name.
-
-
-
Constructor Detail
-
AlgorithmId
@Deprecated public AlgorithmId()
Deprecated.use one of the other constructors.Constructs an algorithm ID which will be initialized separately, for example by deserialization.
-
AlgorithmId
public AlgorithmId(java.lang.String oid)
Constructs a parameterless algorithm ID.- Parameters:
oid- the identifier for the algorithm
-
-
Method Detail
-
getOID
public final java.lang.String 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 thegetNamecall when you do not need to ensure cross-system portability of algorithm names, or need a user friendly name.- Returns:
-
equals
public boolean equals(AlgorithmId other)
Returns true iff the argument indicates the same algorithm with the same parameters.- Parameters:
other-- Returns:
-
equals
public boolean equals(@Nullable java.lang.Object other)Compares this AlgorithmID to another. If algorithm parameters are available, they are compared. Otherwise, just the object IDs for the algorithm are compared.- Overrides:
equalsin classjava.lang.Object- Parameters:
other- preferably an AlgorithmId, else an ObjectIdentifier
-
equals
public final boolean equals(java.lang.String id)
Compares two algorithm IDs for equality. Returns true iff they are the same algorithm, ignoring algorithm parameters.
-
hashCode
public int hashCode()
Returns a hashcode for this AlgorithmId.- Overrides:
hashCodein classjava.lang.Object- Returns:
- a hashcode for this AlgorithmId.
-
getAlgorithmId
@Deprecated public static AlgorithmId getAlgorithmId(java.lang.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.- Parameters:
algname- the name being used- Throws:
NoSuchAlgorithmException- on error.
-
get
public static AlgorithmId get(java.lang.String algname) throws NoSuchAlgorithmException
Returns one of the algorithm IDs most commonly associated with this algorithm name.- Parameters:
algname- the name being used- Throws:
NoSuchAlgorithmException- on error.
-
makeSigAlg
public static java.lang.String makeSigAlg(java.lang.String digAlg, java.lang.String encAlg)Creates a signature algorithm name from a digest algorithm name and a encryption algorithm name.
-
getEncAlgFromSigAlg
public static java.lang.String getEncAlgFromSigAlg(java.lang.String signatureAlgorithm)
Extracts the encryption algorithm name from a signature algorithm name.
-
getDigAlgFromSigAlg
public static java.lang.String getDigAlgFromSigAlg(java.lang.String signatureAlgorithm)
Extracts the digest algorithm name from a signature algorithm name.
-
-