Enum DigestAlgorithm

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<DigestAlgorithm>

    public enum DigestAlgorithm
    extends java.lang.Enum<DigestAlgorithm>
    Message digest algorithms.
    • Enum Constant Detail

      • SHA1

        public static final DigestAlgorithm SHA1
        SHA-1 digest.

        Android 2.3 (API Level 9) to 4.2 (API Level 17) (inclusive) do not support SHA-2 JAR signatures.

        Moreover, platforms prior to API Level 18, without the additional Digest-Algorithms attribute, only support SHA or SHA1 algorithm names in .SF and MANIFEST.MF attributes.

    • Field Detail

      • API_SHA_256_ALL_ALGORITHMS

        public static final int API_SHA_256_ALL_ALGORITHMS
        API level which supports SHA256 for all SignatureAlgorithms.

        Before that, SHA256 can only be used with RSA and ECDSA.

        See Also:
        Constant Field Values
      • messageDigestName

        public final java.lang.String messageDigestName
        Name of algorithm for message digest.
      • manifestAttributeName

        public final java.lang.String manifestAttributeName
        Name of attribute in signature file with the manifest digest.
      • entryAttributeName

        public final java.lang.String entryAttributeName
        Name of attribute in entry (both manifest and signature file) with the entry's digest.
    • Method Detail

      • values

        public static DigestAlgorithm[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (DigestAlgorithm c : DigestAlgorithm.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DigestAlgorithm valueOf​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null