Class AlgorithmId

  • All Implemented Interfaces:
    Serializable

    public class AlgorithmId
    extends Object
    implements Serializable
    Use this class to get OID of supported algorithms see get(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 Detail

      • AlgorithmId

        public AlgorithmId​(String oid)
        Constructs a parameterless algorithm ID.
        Parameters:
        oid - the identifier for the algorithm
    • Method Detail

      • getOID

        public final 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 the getName call 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
                              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:
        equals in class Object
        Parameters:
        other - preferably an AlgorithmId, else an ObjectIdentifier
        Returns:
        true if this object is the same as the obj argument; false otherwise.
        See Also:
        Object.hashCode(), HashMap
      • equals

        public final boolean equals​(String id)
        Compares two algorithm IDs for equality. Returns true iff they are the same algorithm, ignoring algorithm parameters.
      • makeSigAlg

        public static String makeSigAlg​(String digAlg,
                                        String encAlg)
        Creates a signature algorithm name from a digest algorithm name and a encryption algorithm name.
      • getEncAlgFromSigAlg

        public static String getEncAlgFromSigAlg​(String signatureAlgorithm)
        Extracts the encryption algorithm name from a signature algorithm name.
      • getDigAlgFromSigAlg

        public static String getDigAlgFromSigAlg​(String signatureAlgorithm)
        Extracts the digest algorithm name from a signature algorithm name.