Home
last modified time | relevance | path

Searched refs:mKeyStore (Results 1 – 24 of 24) sorted by relevance

/frameworks/base/keystore/tests/src/android/security/
DKeyStoreTest.java72 private KeyStore mKeyStore = null; field in KeyStoreTest
129 mKeyStore = KeyStore.getInstance(); in setUp()
130 if (mKeyStore.state() != KeyStore.State.UNINITIALIZED) { in setUp()
131 mKeyStore.reset(); in setUp()
134 KeyStore.State.UNINITIALIZED, mKeyStore.state()); in setUp()
140 mKeyStore.reset(); in tearDown()
145 assertEquals(KeyStore.State.UNINITIALIZED, mKeyStore.state()); in testState()
149 assertTrue(mKeyStore.onUserPasswordChanged(TEST_PASSWD)); in testPassword()
150 assertEquals(KeyStore.State.UNLOCKED, mKeyStore.state()); in testPassword()
154 assertNull(mKeyStore.get(TEST_KEYNAME)); in testGet()
[all …]
/frameworks/base/keystore/tests/src/android/security/keystore/
DAndroidKeyStoreTest.java63 private java.security.KeyStore mKeyStore; field in AndroidKeyStoreTest
733 mKeyStore = java.security.KeyStore.getInstance("AndroidKeyStore"); in setUp()
744 final Enumeration<String> aliases = mKeyStore.aliases(); in assertAliases()
764 mKeyStore.load(null, null); in testKeyStore_Aliases_Encrypted_Success()
784 mKeyStore.aliases(); in testKeyStore_Aliases_NotInitialized_Encrypted_Failure()
793 mKeyStore.load(null, null); in testKeyStore_ContainsAliases_PrivateAndCA_Encrypted_Success()
801 assertTrue("Should contain generated private key", mKeyStore.containsAlias(TEST_ALIAS_1)); in testKeyStore_ContainsAliases_PrivateAndCA_Encrypted_Success()
806 assertTrue("Should contain added CA certificate", mKeyStore.containsAlias(TEST_ALIAS_2)); in testKeyStore_ContainsAliases_PrivateAndCA_Encrypted_Success()
809 mKeyStore.containsAlias(TEST_ALIAS_3)); in testKeyStore_ContainsAliases_PrivateAndCA_Encrypted_Success()
815 mKeyStore.load(null, null); in testKeyStore_ContainsAliases_CAOnly_Encrypted_Success()
[all …]
/frameworks/base/keystore/java/android/security/keystore/
DAndroidKeyStoreSpi.java86 private KeyStore mKeyStore; field in AndroidKeyStoreSpi
95 mKeyStore, privateKeyAlias, mUid); in engineGetKey()
99 mKeyStore, secretKeyAlias, mUid); in engineGetKey()
119 final byte[] caBytes = mKeyStore.get(Credentials.CA_CERTIFICATE + alias, mUid); in engineGetCertificateChain()
145 byte[] encodedCert = mKeyStore.get(Credentials.USER_CERTIFICATE + alias, mUid); in engineGetCertificate()
150 encodedCert = mKeyStore.get(Credentials.CA_CERTIFICATE + alias, mUid); in engineGetCertificate()
187 if (mKeyStore.contains(privateKeyAlias, mUid)) { in getCertificateForPrivateKeyEntry()
239 final long epochMillis = mKeyStore.getmtime(alias, mUid); in getModificationDate()
522 Credentials.deleteAllTypesForAlias(mKeyStore, alias, mUid); in setPrivateKeyEntry()
524 int errorCode = mKeyStore.importKey( in setPrivateKeyEntry()
[all …]
DAndroidKeyStoreHmacSpi.java71 private final KeyStore mKeyStore = KeyStore.getInstance(); field in AndroidKeyStoreHmacSpi
131 mKeyStore.abort(operationToken); in resetAll()
141 mKeyStore.abort(operationToken); in resetWhilePreservingInitState()
166 OperationResult opResult = mKeyStore.begin( in ensureKeystoreOperationInitialized()
185 mKeyStore, mKey, opResult.resultCode); in ensureKeystoreOperationInitialized()
199 mKeyStore, mOperationToken)); in ensureKeystoreOperationInitialized()
254 mKeyStore.abort(operationToken); in finalize()
DAndroidKeyStoreSignatureSpiBase.java47 private final KeyStore mKeyStore; field in AndroidKeyStoreSignatureSpiBase
72 mKeyStore = KeyStore.getInstance(); in AndroidKeyStoreSignatureSpiBase()
157 mKeyStore.abort(operationToken); in resetAll()
181 mKeyStore.abort(operationToken); in resetWhilePreservingInitState()
202 OperationResult opResult = mKeyStore.begin( in ensureKeystoreOperationInitialized()
220 mKeyStore, mKey, opResult.resultCode); in ensureKeystoreOperationInitialized()
232 mMessageStreamer = createMainDataStreamer(mKeyStore, opResult.token); in ensureKeystoreOperationInitialized()
399 return mKeyStore; in getKeyStore()
DAndroidKeyStoreCipherSpiBase.java67 private final KeyStore mKeyStore; field in AndroidKeyStoreCipherSpiBase
96 mKeyStore = KeyStore.getInstance(); in AndroidKeyStoreCipherSpiBase()
188 mKeyStore.abort(operationToken); in resetAll()
214 mKeyStore.abort(operationToken); in resetWhilePreservingInitState()
248 OperationResult opResult = mKeyStore.begin( in ensureKeystoreOperationInitialized()
266 mKeyStore, mKey, opResult.resultCode); in ensureKeystoreOperationInitialized()
285 mMainDataStreamer = createMainDataStreamer(mKeyStore, opResult.token); in ensureKeystoreOperationInitialized()
287 createAdditionalAuthenticationDataStreamer(mKeyStore, opResult.token); in ensureKeystoreOperationInitialized()
744 mKeyStore.abort(operationToken); in finalize()
781 return mKeyStore; in getKeyStore()
DAndroidKeyStoreKeyPairGeneratorSpi.java151 private KeyStore mKeyStore; field in AndroidKeyStoreKeyPairGeneratorSpi
356 mKeyStore = KeyStore.getInstance(); in initialize()
380 mKeyStore = null; in resetAll()
448 if (mKeyStore == null || mSpec == null) { in generateKeyPair()
454 && (mKeyStore.state() != KeyStore.State.UNLOCKED)) { in generateKeyPair()
464 Credentials.deleteAllTypesForAlias(mKeyStore, mEntryAlias, mEntryUid); in generateKeyPair()
478 Credentials.deleteAllTypesForAlias(mKeyStore, mEntryAlias, mEntryUid); in generateKeyPair()
499 int errorCode = mKeyStore.generateKey(privateKeyAlias, args, additionalEntropy, in generateKeystoreKeyPair()
510 mKeyStore, privateKeyAlias, mEntryUid); in loadKeystoreKeyPair()
572 int insertErrorCode = mKeyStore.insert( in storeCertificate()
[all …]
DKeyStoreCryptoOperationChunkedStreamer.java323 private final KeyStore mKeyStore; field in KeyStoreCryptoOperationChunkedStreamer.MainDataStream
327 mKeyStore = keyStore; in MainDataStream()
333 return mKeyStore.update(mOperationToken, null, input); in update()
338 return mKeyStore.finish(mOperationToken, null, signature, additionalEntropy); in finish()
DAndroidKeyStoreKeyGeneratorSpi.java100 private final KeyStore mKeyStore = KeyStore.getInstance(); field in AndroidKeyStoreKeyGeneratorSpi
304 Credentials.deleteAllTypesForAlias(mKeyStore, spec.getKeystoreAlias(), spec.getUid()); in engineGenerateKey()
305 int errorCode = mKeyStore.generateKey( in engineGenerateKey()
330 mKeyStore, spec.getKeystoreAlias(), spec.getUid()); in engineGenerateKey()
DAndroidKeyStoreKeyFactorySpi.java41 private final KeyStore mKeyStore = KeyStore.getInstance(); field in AndroidKeyStoreKeyFactorySpi
75 mKeyStore, entryAlias, keyAliasInKeystore, keystorePrivateKey.getUid()); in engineGetKeySpec()
DAndroidKeyStoreAuthenticatedAESCipherSpi.java405 private final KeyStore mKeyStore; field in AndroidKeyStoreAuthenticatedAESCipherSpi.AdditionalAuthenticationDataStream
409 mKeyStore = keyStore; in AdditionalAuthenticationDataStream()
421 OperationResult result = mKeyStore.update(mOperationToken, keymasterArgs, null); in update()
DAndroidKeyStoreSecretKeyFactorySpi.java45 private final KeyStore mKeyStore = KeyStore.getInstance(); field in AndroidKeyStoreSecretKeyFactorySpi
73 return getKeyInfo(mKeyStore, entryAlias, keyAliasInKeystore, keystoreKey.getUid()); in engineGetKeySpec()
/frameworks/base/core/java/android/security/net/config/
DKeyStoreCertificateSource.java36 private final KeyStore mKeyStore; field in KeyStoreCertificateSource
41 mKeyStore = ks; in KeyStoreCertificateSource()
58 Set<X509Certificate> certificates = new ArraySet<>(mKeyStore.size()); in ensureInitialized()
59 for (Enumeration<String> en = mKeyStore.aliases(); en.hasMoreElements();) { in ensureInitialized()
61 X509Certificate cert = (X509Certificate) mKeyStore.getCertificate(alias); in ensureInitialized()
/frameworks/base/packages/Osu/src/com/android/hotspot2/osu/
DWiFiKeyManager.java27 private final KeyStore mKeyStore; field in WiFiKeyManager
31 mKeyStore = keyStore; in WiFiKeyManager()
42 Enumeration<String> aliases = mKeyStore.aliases(); in enableClientAuth()
45 Certificate cert = mKeyStore.getCertificate(alias); in enableClientAuth()
46 if ((cert instanceof X509Certificate) && mKeyStore.getKey(alias, null) != null) { in enableClientAuth()
151 for (Certificate certificate : mKeyStore.getCertificateChain(alias)) { in getCertificateChain()
166 return (PrivateKey) mKeyStore.getKey(alias, null); in getPrivateKey()
DClientKeyManager.java24 private final KeyStore mKeyStore; field in ClientKeyManager
31 mKeyStore = keyStore; in ClientKeyManager()
90 mKeyStore.getCertificateChain(mAliasMap.get(OSUCertType.Client))) { in getCertificateChain()
115 return (PrivateKey) mKeyStore.getKey(mAliasMap.get(OSUCertType.PrivateKey), null); in getPrivateKey()
DOSUManager.java104 private final KeyStore mKeyStore; field in OSUManager
129 mKeyStore = ks; in OSUManager()
240 return mKeyStore; in getKeyStore()
560 mProvisioningThread = new OSUThread(osuInfo, this, getKeyManager(null, mKeyStore)); in initiateProvisioning()
776 getKeyManager(homeSP, mKeyStore), in doRemediate()
864 Set<X509Certificate> rootCerts = OSUSocketFactory.getRootCerts(mKeyStore); in provisioningComplete()
869 mKeyStore.setKeyEntry(CERT_CLT_KEY_ALIAS + homeSP, in provisioningComplete()
872 mKeyStore.setCertificateEntry(CERT_CLT_CERT_ALIAS, cltCert); in provisioningComplete()
879 mKeyStore.setCertificateEntry(CERT_SHARED_ALIAS + homeSP.getFQDN(), in provisioningComplete()
884 mKeyStore.setCertificateEntry(CERT_REM_ALIAS + homeSP.getFQDN(), in provisioningComplete()
[all …]
DOSUClient.java58 private final KeyStore mKeyStore; field in OSUClient
63 mKeyStore = ks; in OSUClient()
69 mKeyStore = ks; in OSUClient()
75 OSUSocketFactory.getSocketFactory(mKeyStore, null, OSUManager.FLOW_PROVISIONING, in provision() argument
163 km, mKeyStore, null, OSUManager.FLOW_PROVISIONING)) { in provision() argument
199 retrieveCerts(moData.getMOTree().getRoot(), certs, network, km, mKeyStore); in provision() local
279 km, mKeyStore, homeSP, flowType)) { in remediate() argument
385 OSUSocketFactory.getSocketFactory(mKeyStore, homeSP, flowType, network, in createHandler()
389 OSUSocketFactory.getSocketFactory(mKeyStore, homeSP, flowType, network, in createHandler()
DOSUSocketFactory.java216 private final KeyStore mKeyStore; field in OSUSocketFactory.WFATrustManager
223 mKeyStore = ks; in WFATrustManager()
247 for (X509Certificate cert : getRootCerts(mKeyStore)) { in checkServerTrusted()
254 X509Certificate cert = getCert(mKeyStore, prefix + mHomeSP.getFQDN()); in checkServerTrusted()
256 cert = getCert(mKeyStore, OSUManager.CERT_SHARED_ALIAS + mHomeSP.getFQDN()); in checkServerTrusted()
259 for (X509Certificate root : getRootCerts(mKeyStore)) { in checkServerTrusted()
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/
DWifiInjector.java41 private final KeyStore mKeyStore = KeyStore.getInstance(); field in WifiInjector
62 return mKeyStore; in getKeyStore()
DWifiConfigStore.java99 private final KeyStore mKeyStore; field in WifiConfigStore
109 mKeyStore = keyStore; in WifiConfigStore()
477 ret = mKeyStore.importKey(privKeyName, privKeyData, Process.WIFI_UID, in installKeys()
487 mKeyStore.delete(privKeyName, Process.WIFI_UID); in installKeys()
510 mKeyStore.delete(privKeyName, Process.WIFI_UID); in installKeys()
511 mKeyStore.delete(userCertName, Process.WIFI_UID); in installKeys()
515 mKeyStore.delete(Credentials.CA_CERTIFICATE + addedAlias, Process.WIFI_UID); in installKeys()
525 mKeyStore.delete(Credentials.CA_CERTIFICATE + oldAlias, Process.WIFI_UID); in installKeys()
545 return mKeyStore.put(name, certData, Process.WIFI_UID, KeyStore.FLAG_NONE); in putCertInKeyStore()
564 mKeyStore.delete(Credentials.USER_PRIVATE_KEY + client, Process.WIFI_UID); in removeKeys()
[all …]
DWifiConfigManager.java269 private final KeyStore mKeyStore; field in WifiConfigManager
346 mKeyStore = keyStore; in WifiConfigManager()
409 new WifiConfigStore(context, wifiNative, mKeyStore, mLocalLog, mShowNetworks, true); in WifiConfigManager()
2051 new Credential(config.enterpriseConfig, mKeyStore, !newNetwork); in addOrUpdateNetworkNative()
/frameworks/base/services/core/java/com/android/server/
DLockSettingsService.java134 private final KeyStore mKeyStore = KeyStore.getInstance(); field in LockSettingsService
1227 mKeyStore.clearUid(UserHandle.getUid(profileId, uid)); in resetKeyStore()
DConnectivityService.java214 private KeyStore mKeyStore; field in ConnectivityService
741 mKeyStore = KeyStore.getInstance(); in ConnectivityService()
3561 mVpns.get(user).startLegacyVpn(profile, mKeyStore, egress); in startLegacyVpn()
3658 final String profileName = new String(mKeyStore.get(Credentials.LOCKDOWN_VPN)); in updateLockdownVpn()
3660 profileName, mKeyStore.get(Credentials.VPN + profileName)); in updateLockdownVpn()
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/
DWifiConfigManagerTest.java144 private KeyStore mKeyStore; field in WifiConfigManagerTest