Add argument to binder call to check key types
Before there was only one key type supported, so we didn't need to query a key type. Now there is DSA, EC, and RSA, so there needs to be another argument. Bug: 10600582 Change-Id: I9fe9e46b9ec9cfb2f1246179b2c396216b2c1fdb
This commit is contained in:
@@ -34,6 +34,7 @@ import java.security.cert.CertificateException;
|
||||
import java.security.cert.CertificateFactory;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
@@ -364,7 +365,8 @@ public final class KeyChain {
|
||||
* "RSA").
|
||||
*/
|
||||
public static boolean isKeyAlgorithmSupported(String algorithm) {
|
||||
return "RSA".equals(algorithm);
|
||||
final String algUpper = algorithm.toUpperCase(Locale.US);
|
||||
return "DSA".equals(algUpper) || "EC".equals(algUpper) || "RSA".equals(algUpper);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -379,7 +381,7 @@ public final class KeyChain {
|
||||
return false;
|
||||
}
|
||||
|
||||
return KeyStore.getInstance().isHardwareBacked();
|
||||
return KeyStore.getInstance().isHardwareBacked(algorithm);
|
||||
}
|
||||
|
||||
private static X509Certificate toCertificate(byte[] bytes) {
|
||||
|
||||
Reference in New Issue
Block a user