Enum DigestAlgorithm

    • Method Detail

      • values

        public static DigestAlgorithm[] values()
        Returns an array containing the constants of this enum type, in the order they are declared.
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DigestAlgorithm valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • forName

        public static DigestAlgorithm forName​(String name)
        Returns the digest algorithm associated to the given name.
        Parameters:
        name - the algorithm name
        Returns:
        the digest algorithm linked to the given name
        Throws:
        IllegalArgumentException - if the given name doesn't match any algorithm
      • forName

        public static DigestAlgorithm forName​(String name,
                                              DigestAlgorithm defaultValue)
        Returns the digest algorithm associated to the given name.
        Parameters:
        name - the algorithm name
        defaultValue - The default value for the DigestAlgorithm
        Returns:
        the corresponding DigestAlgorithm or the default value
      • isSupportedAlgorithm

        public static boolean isSupportedAlgorithm​(String name)
        Returns indication if the algorithm with given name is supported
        Parameters:
        name - String target algorithm's name
        Returns:
        TRUE if the algorithm is supported, FALSE otherwise
      • forJavaName

        public static DigestAlgorithm forJavaName​(String javaName)
        Returns the digest algorithm associated to the given JCE name.
        Parameters:
        javaName - the JCE algorithm name
        Returns:
        the digest algorithm linked to the given name
        Throws:
        IllegalArgumentException - if the given name doesn't match any algorithm
      • forOID

        public static DigestAlgorithm forOID​(String oid)
        Returns the digest algorithm associated to the given OID.
        Parameters:
        oid - the algorithm oid
        Returns:
        the digest algorithm linked to the oid
        Throws:
        IllegalArgumentException - if the oid doesn't match any digest algorithm
      • forXML

        public static DigestAlgorithm forXML​(String xmlName)
        Returns the digest algorithm associated to the given XML url.
        Parameters:
        xmlName - the algorithm uri
        Returns:
        the digest algorithm linked to the given uri
        Throws:
        IllegalArgumentException - if the uri doesn't match any digest algorithm
      • forXML

        public static DigestAlgorithm forXML​(String xmlName,
                                             DigestAlgorithm defaultValue)
        Returns the digest algorithm associated to the given XML url or the default one if the algorithm does not exist.
        Parameters:
        xmlName - The XML representation of the digest algorithm
        defaultValue - The default value for the DigestAlgorithm
        Returns:
        the corresponding DigestAlgorithm or the default value
      • getName

        public String getName()
        Get the algorithm name
        Returns:
        the algorithm name
      • getJavaName

        public String getJavaName()
        Get the JCE algorithm name
        Returns:
        the java algorithm name
      • getOid

        public String getOid()
        Get the algorithm OID
        Specified by:
        getOid in interface OidBasedEnum
        Returns:
        the ASN1 algorithm OID
      • getUri

        public String getUri()
        Get the algorithm uri
        Specified by:
        getUri in interface UriBasedEnum
        Returns:
        the algorithm uri
      • getSaltLength

        public int getSaltLength()
        Get the salt length (PSS)
        Returns:
        the salt length