Keystore 2.0: Make Legacy VPN settings ready for Keystore 2.0
Keystore 2.0 no longer stores vpn profiles. It still offers a Legacy VPN profile store, to access existing profiles. Test: N/A Bug: 171305607 Bug: 171305388 Change-Id: I40dea0b9c3824b56814ae4c2fb6c7663c7d97af5
This commit is contained in:
@@ -28,6 +28,7 @@ import java.security.KeyStoreException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.PrivateKey;
|
||||
import java.security.UnrecoverableKeyException;
|
||||
import java.security.cert.Certificate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Enumeration;
|
||||
@@ -88,6 +89,10 @@ public class AndroidKeystoreAliasLoader {
|
||||
if (key != null) {
|
||||
if (key instanceof PrivateKey) {
|
||||
mKeyCertAliases.add(alias);
|
||||
final Certificate[] cert = keyStore.getCertificateChain(alias);
|
||||
if (cert != null && cert.length >= 2) {
|
||||
mCaCertAliases.add(alias);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (keyStore.getCertificate(alias) != null) {
|
||||
|
Reference in New Issue
Block a user