Enum SignatureAlgorithm
- java.lang.Object
-
- java.lang.Enum<SignatureAlgorithm>
-
- com.android.tools.build.apkzlib.sign.SignatureAlgorithm
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<SignatureAlgorithm>
public enum SignatureAlgorithm extends java.lang.Enum<SignatureAlgorithm>
Signature algorithm.
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.StringkeyAlgorithmName of the private key as reported byPrivateKey.intminSdkVersionMinimum SDK version that allows this signature.java.lang.StringsignatureAlgorithmSuffixSuffix appended to digest algorithm to obtain signature algorithm.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SignatureAlgorithmfromKeyAlgorithm(java.lang.String keyAlgorithm, int minSdkVersion)Obtains the signature algorithm that corresponds to a private key name applicable to a SDK version.java.lang.StringsignatureAlgorithmName(DigestAlgorithm digestAlgorithm)Obtains the name of the signature algorithm when used with a digest algorithm.static SignatureAlgorithmvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static SignatureAlgorithm[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
RSA
public static final SignatureAlgorithm RSA
RSA algorithm.
-
ECDSA
public static final SignatureAlgorithm ECDSA
ECDSA algorithm.
-
DSA
public static final SignatureAlgorithm DSA
DSA algorithm.
-
-
Field Detail
-
keyAlgorithm
public final java.lang.String keyAlgorithm
Name of the private key as reported byPrivateKey.
-
minSdkVersion
public final int minSdkVersion
Minimum SDK version that allows this signature.
-
signatureAlgorithmSuffix
public final java.lang.String signatureAlgorithmSuffix
Suffix appended to digest algorithm to obtain signature algorithm.
-
-
Method Detail
-
values
public static SignatureAlgorithm[] 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 (SignatureAlgorithm c : SignatureAlgorithm.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SignatureAlgorithm 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 namejava.lang.NullPointerException- if the argument is null
-
fromKeyAlgorithm
public static SignatureAlgorithm fromKeyAlgorithm(java.lang.String keyAlgorithm, int minSdkVersion) throws java.security.NoSuchAlgorithmException
Obtains the signature algorithm that corresponds to a private key name applicable to a SDK version.- Parameters:
keyAlgorithm- the named referred in thePrivateKeyminSdkVersion- minimum SDK version to run- Returns:
- the algorithm that has
keyAlgorithmequal tokeyAlgorithm - Throws:
java.security.NoSuchAlgorithmException- if no algorithm was found for the given private key; an algorithm was found but is not applicable to the given SDK version
-
signatureAlgorithmName
public java.lang.String signatureAlgorithmName(DigestAlgorithm digestAlgorithm)
Obtains the name of the signature algorithm when used with a digest algorithm.- Parameters:
digestAlgorithm- the digest algorithm to use- Returns:
- the name of the signature algorithm
-
-