Home
last modified time | relevance | path

Searched refs:keyStore (Results 1 – 25 of 55) sorted by relevance

123

/external/conscrypt/repackaged/testing/src/main/java/com/android/org/conscrypt/java/security/
DTestKeyStore.java162 public final KeyStore keyStore; field in TestKeyStore
169 private TestKeyStore(KeyStore keyStore, char[] storePassword, char[] keyPassword) { in TestKeyStore() argument
170 this.keyStore = keyStore; in TestKeyStore()
173 this.keyManagers = createKeyManagers(keyStore, storePassword); in TestKeyStore()
174 this.trustManagers = createTrustManagers(keyStore); in TestKeyStore()
178 public static KeyManager[] createKeyManagers(KeyStore keyStore, char[] storePassword) { in createKeyManagers() argument
182 kmf.init(keyStore, storePassword); in createKeyManagers()
189 public static TrustManager[] createTrustManagers(final KeyStore keyStore) { in createTrustManagers() argument
193 tmf.init(keyStore); in createTrustManagers()
201 return new TestKeyStore(keyStore, storePassword, keyPassword); in copy()
[all …]
/external/conscrypt/testing/src/main/java/org/conscrypt/java/security/
DTestKeyStore.java160 public final KeyStore keyStore; field in TestKeyStore
167 private TestKeyStore(KeyStore keyStore, char[] storePassword, char[] keyPassword) { in TestKeyStore() argument
168 this.keyStore = keyStore; in TestKeyStore()
171 this.keyManagers = createKeyManagers(keyStore, storePassword); in TestKeyStore()
172 this.trustManagers = createTrustManagers(keyStore); in TestKeyStore()
176 public static KeyManager[] createKeyManagers(KeyStore keyStore, char[] storePassword) { in createKeyManagers() argument
180 kmf.init(keyStore, storePassword); in createKeyManagers()
187 public static TrustManager[] createTrustManagers(final KeyStore keyStore) { in createTrustManagers() argument
191 tmf.init(keyStore); in createTrustManagers()
199 return new TestKeyStore(keyStore, storePassword, keyPassword); in copy()
[all …]
/external/conscrypt/repackaged/common/src/test/java/com/android/org/conscrypt/javax/net/ssl/
DKeyManagerFactoryTest.java138 KeyStore.Builder builder = KeyStore.Builder.newInstance(getTestKeyStore().keyStore, pp); in test_KeyManagerFactory()
157 kmf.init(getTestKeyStore().keyStore, getTestKeyStore().storePassword); in test_KeyManagerFactory()
349 kmf.init(new NoGetEntryKeyStore(getTestKeyStore().keyStore), in test_KeyManagerFactory_Conscrypt()
355 public NoGetEntryKeyStore(KeyStore keyStore) throws Exception { in NoGetEntryKeyStore() argument
356 super(new NoGetEntryKeyStoreSpi(keyStore), keyStore.getProvider(), keyStore.getType()); in NoGetEntryKeyStore()
366 private final KeyStore keyStore; field in KeyManagerFactoryTest.NoGetEntryKeyStoreSpi
368 public NoGetEntryKeyStoreSpi(KeyStore keyStore) { in NoGetEntryKeyStoreSpi() argument
369 this.keyStore = keyStore; in NoGetEntryKeyStoreSpi()
381 return keyStore.getKey(s, chars); in engineGetKey()
390 return keyStore.getCertificateChain(s); in engineGetCertificateChain()
[all …]
DTrustManagerFactoryTest.java116 PKIXParameters pp = new PKIXParameters(getTestKeyStore().keyStore); in test_TrustManagerFactory()
126 PKIXBuilderParameters pbp = new PKIXBuilderParameters(getTestKeyStore().keyStore, xcs); in test_TrustManagerFactory()
145 tmf.init(getTestKeyStore().keyStore); in test_TrustManagerFactory()
230 final KeyStore keyStore = TestKeyStore.createKeyStore(); in test_TrustManagerFactory_intermediate() local
231 keyStore.setCertificateEntry("alias", chain[1]); in test_TrustManagerFactory_intermediate()
238 tmf.init(keyStore); in test_TrustManagerFactory_intermediate()
DKeyStoreBuilderParametersTest.java70 testKeyStore.keyStore, new PasswordProtection(testKeyStore.storePassword)); in test_init_Builder()
93 testKeyStore1.keyStore, new PasswordProtection(testKeyStore1.storePassword)); in test_init_List()
95 testKeyStore2.keyStore, new PasswordProtection(testKeyStore2.storePassword)); in test_init_List()
/external/conscrypt/common/src/test/java/org/conscrypt/javax/net/ssl/
DKeyManagerFactoryTest.java134 KeyStore.Builder builder = KeyStore.Builder.newInstance(getTestKeyStore().keyStore, pp); in test_KeyManagerFactory()
153 kmf.init(getTestKeyStore().keyStore, getTestKeyStore().storePassword); in test_KeyManagerFactory()
345 kmf.init(new NoGetEntryKeyStore(getTestKeyStore().keyStore), in test_KeyManagerFactory_Conscrypt()
351 public NoGetEntryKeyStore(KeyStore keyStore) throws Exception { in NoGetEntryKeyStore() argument
352 super(new NoGetEntryKeyStoreSpi(keyStore), keyStore.getProvider(), keyStore.getType()); in NoGetEntryKeyStore()
362 private final KeyStore keyStore; field in KeyManagerFactoryTest.NoGetEntryKeyStoreSpi
364 public NoGetEntryKeyStoreSpi(KeyStore keyStore) { in NoGetEntryKeyStoreSpi() argument
365 this.keyStore = keyStore; in NoGetEntryKeyStoreSpi()
377 return keyStore.getKey(s, chars); in engineGetKey()
386 return keyStore.getCertificateChain(s); in engineGetCertificateChain()
[all …]
DTrustManagerFactoryTest.java112 PKIXParameters pp = new PKIXParameters(getTestKeyStore().keyStore); in test_TrustManagerFactory()
122 PKIXBuilderParameters pbp = new PKIXBuilderParameters(getTestKeyStore().keyStore, xcs); in test_TrustManagerFactory()
141 tmf.init(getTestKeyStore().keyStore); in test_TrustManagerFactory()
226 final KeyStore keyStore = TestKeyStore.createKeyStore(); in test_TrustManagerFactory_intermediate() local
227 keyStore.setCertificateEntry("alias", chain[1]); in test_TrustManagerFactory_intermediate()
234 tmf.init(keyStore); in test_TrustManagerFactory_intermediate()
DKeyStoreBuilderParametersTest.java66 testKeyStore.keyStore, new PasswordProtection(testKeyStore.storePassword)); in test_init_Builder()
89 testKeyStore1.keyStore, new PasswordProtection(testKeyStore1.storePassword)); in test_init_List()
91 testKeyStore2.keyStore, new PasswordProtection(testKeyStore2.storePassword)); in test_init_List()
/external/wycheproof/keystore-cts/java/android/keystore/cts/util/
DKeyStoreUtil.java70 KeyStore keyStore = KeyStore.getInstance("AndroidKeyStore"); in saveKeysToKeystore() local
71 keyStore.load(null); in saveKeysToKeystore()
72 keyStore.setEntry(alias, in saveKeysToKeystore()
75 return keyStore; in saveKeysToKeystore()
80 KeyStore keyStore = KeyStore.getInstance("AndroidKeyStore"); in saveSecretKeyToKeystore() local
81 keyStore.load(null); in saveSecretKeyToKeystore()
82 keyStore.setEntry(alias, in saveSecretKeyToKeystore()
85 return keyStore; in saveSecretKeyToKeystore()
89 KeyStore keyStore = KeyStore.getInstance("AndroidKeyStore"); in cleanUpKeyStore() local
90 keyStore.load(null); in cleanUpKeyStore()
[all …]
/external/okhttp/mockwebserver/src/main/java/com/squareup/okhttp/internal/
DSslContextBuilder.java93 KeyStore keyStore = newEmptyKeyStore(password); in build() local
100 keyStore.setKeyEntry("private", chain[0].keyPair.getPrivate(), password, certificates); in build()
104 keyStore.setCertificateEntry("cert_" + i, trustedCertificates.get(i)); in build()
110 keyManagerFactory.init(keyStore, password); in build()
113 trustManagerFactory.init(keyStore); in build()
122 KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); in newEmptyKeyStore() local
124 keyStore.load(in, password); in newEmptyKeyStore()
125 return keyStore; in newEmptyKeyStore()
/external/conscrypt/common/src/main/java/org/conscrypt/
DKeyManagerFactoryImpl.java42 private KeyStore keyStore; field in KeyManagerFactoryImpl
55 keyStore = ks; in engineInit()
62 keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); in engineInit()
67 keyStore.load(null, null); in engineInit()
83 keyStore.load(fis, pwd); in engineInit()
115 if (keyStore == null) { in engineGetKeyManagers()
118 return new KeyManager[] { new KeyManagerImpl(keyStore, pwd) }; in engineGetKeyManagers()
DTrustManagerFactoryImpl.java53 private KeyStore keyStore; field in TrustManagerFactoryImpl
61 keyStore = ks; in engineInit()
63 keyStore = Platform.getDefaultCertKeyStore(); in engineInit()
82 if (keyStore == null) { in engineGetTrustManagers()
86 return new TrustManager[] { new TrustManagerImpl(keyStore) }; in engineGetTrustManagers()
DKeyManagerImpl.java59 KeyManagerImpl(KeyStore keyStore, char[] pwd) { in KeyManagerImpl() argument
63 aliases = keyStore.aliases(); in KeyManagerImpl()
70 if (keyStore.entryInstanceOf(alias, PrivateKeyEntry.class)) { in KeyManagerImpl()
73 entry = (PrivateKeyEntry) keyStore in KeyManagerImpl()
78 PrivateKey key = (PrivateKey) keyStore.getKey(alias, pwd); in KeyManagerImpl()
79 Certificate[] certs = keyStore.getCertificateChain(alias); in KeyManagerImpl()
DTrustManagerImpl.java153 public TrustManagerImpl(KeyStore keyStore) { in TrustManagerImpl() argument
154 this(keyStore, null); in TrustManagerImpl()
157 public TrustManagerImpl(KeyStore keyStore, CertPinManager manager) { in TrustManagerImpl() argument
158 this(keyStore, manager, null); in TrustManagerImpl()
161 public TrustManagerImpl(KeyStore keyStore, CertPinManager manager, in TrustManagerImpl() argument
163 this(keyStore, manager, certStore, null); in TrustManagerImpl()
166 public TrustManagerImpl(KeyStore keyStore, CertPinManager manager, in TrustManagerImpl() argument
169 this(keyStore, manager, certStore, blocklist, null, null, null); in TrustManagerImpl()
175 public TrustManagerImpl(KeyStore keyStore, CertPinManager manager, in TrustManagerImpl() argument
190 if ("AndroidCAStore".equals(keyStore.getType()) in TrustManagerImpl()
[all …]
/external/conscrypt/repackaged/common/src/main/java/com/android/org/conscrypt/
DKeyManagerFactoryImpl.java44 private KeyStore keyStore; field in KeyManagerFactoryImpl
57 keyStore = ks; in engineInit()
64 keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); in engineInit()
69 keyStore.load(null, null); in engineInit()
85 keyStore.load(fis, pwd); in engineInit()
117 if (keyStore == null) { in engineGetKeyManagers()
120 return new KeyManager[] { new KeyManagerImpl(keyStore, pwd) }; in engineGetKeyManagers()
DTrustManagerFactoryImpl.java55 private KeyStore keyStore; field in TrustManagerFactoryImpl
63 keyStore = ks; in engineInit()
65 keyStore = Platform.getDefaultCertKeyStore(); in engineInit()
84 if (keyStore == null) { in engineGetTrustManagers()
88 return new TrustManager[] { new TrustManagerImpl(keyStore) }; in engineGetTrustManagers()
DKeyManagerImpl.java60 KeyManagerImpl(KeyStore keyStore, char[] pwd) { in KeyManagerImpl() argument
64 aliases = keyStore.aliases(); in KeyManagerImpl()
71 if (keyStore.entryInstanceOf(alias, PrivateKeyEntry.class)) { in KeyManagerImpl()
74 entry = (PrivateKeyEntry) keyStore.getEntry( in KeyManagerImpl()
79 PrivateKey key = (PrivateKey) keyStore.getKey(alias, pwd); in KeyManagerImpl()
80 Certificate[] certs = keyStore.getCertificateChain(alias); in KeyManagerImpl()
DTrustManagerImpl.java156 public TrustManagerImpl(KeyStore keyStore) { in TrustManagerImpl() argument
157 this(keyStore, null); in TrustManagerImpl()
160 public TrustManagerImpl(KeyStore keyStore, CertPinManager manager) { in TrustManagerImpl() argument
161 this(keyStore, manager, null); in TrustManagerImpl()
166 KeyStore keyStore, CertPinManager manager, ConscryptCertStore certStore) { in TrustManagerImpl() argument
167 this(keyStore, manager, certStore, null); in TrustManagerImpl()
170 public TrustManagerImpl(KeyStore keyStore, CertPinManager manager, ConscryptCertStore certStore, in TrustManagerImpl() argument
172 this(keyStore, manager, certStore, blocklist, null, null, null); in TrustManagerImpl()
178 public TrustManagerImpl(KeyStore keyStore, CertPinManager manager, ConscryptCertStore certStore, in TrustManagerImpl() argument
193 if ("AndroidCAStore".equals(keyStore.getType()) in TrustManagerImpl()
[all …]
/external/okhttp/samples/guide/src/main/java/com/squareup/okhttp/recipes/
DCustomTrust.java169 KeyStore keyStore = newEmptyKeyStore(password); in sslContextForTrustedCertificates() local
173 keyStore.setCertificateEntry(certificateAlias, certificate); in sslContextForTrustedCertificates()
179 keyManagerFactory.init(keyStore, password); in sslContextForTrustedCertificates()
182 trustManagerFactory.init(keyStore); in sslContextForTrustedCertificates()
194 KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); in newEmptyKeyStore() local
196 keyStore.load(in, password); in newEmptyKeyStore()
197 return keyStore; in newEmptyKeyStore()
/external/conscrypt/testing/src/main/java/org/conscrypt/javax/net/ssl/
DTestSSLContext.java342 return new TestSSLContext(client != null ? client.keyStore : null, in build()
343 clientStorePassword, server != null ? server.keyStore : null, in build()
386 public static void assertCertificateInKeyStore(Principal principal, KeyStore keyStore) in assertCertificateInKeyStore() argument
390 for (String alias : Collections.list(keyStore.aliases())) { in assertCertificateInKeyStore()
391 if (!keyStore.isCertificateEntry(alias)) { in assertCertificateInKeyStore()
394 X509Certificate keyStoreCertificate = (X509Certificate) keyStore.getCertificate(alias); in assertCertificateInKeyStore()
402 public static void assertCertificateInKeyStore(Certificate certificate, KeyStore keyStore) in assertCertificateInKeyStore() argument
405 for (String alias : Collections.list(keyStore.aliases())) { in assertCertificateInKeyStore()
406 if (!keyStore.isCertificateEntry(alias)) { in assertCertificateInKeyStore()
409 Certificate keyStoreCertificate = keyStore.getCertificate(alias); in assertCertificateInKeyStore()
/external/conscrypt/repackaged/testing/src/main/java/com/android/org/conscrypt/javax/net/ssl/
DTestSSLContext.java347 return new TestSSLContext(client != null ? client.keyStore : null, in build()
348 clientStorePassword, server != null ? server.keyStore : null, in build()
391 public static void assertCertificateInKeyStore(Principal principal, KeyStore keyStore) in assertCertificateInKeyStore() argument
395 for (String alias : Collections.list(keyStore.aliases())) { in assertCertificateInKeyStore()
396 if (!keyStore.isCertificateEntry(alias)) { in assertCertificateInKeyStore()
399 X509Certificate keyStoreCertificate = (X509Certificate) keyStore.getCertificate(alias); in assertCertificateInKeyStore()
407 public static void assertCertificateInKeyStore(Certificate certificate, KeyStore keyStore) in assertCertificateInKeyStore() argument
410 for (String alias : Collections.list(keyStore.aliases())) { in assertCertificateInKeyStore()
411 if (!keyStore.isCertificateEntry(alias)) { in assertCertificateInKeyStore()
414 Certificate keyStoreCertificate = keyStore.getCertificate(alias); in assertCertificateInKeyStore()
/external/nist-sip/java/gov/nist/core/net/
DSslNetworkLayer.java77 KeyStore keyStore = KeyStore.getInstance(keyStoreType); in SslNetworkLayer() local
79 keyStore.load(new FileInputStream(keyStoreFile), keyStorePassword); in SslNetworkLayer()
82 kmFactory.init(keyStore, keyStorePassword); in SslNetworkLayer()
/external/wycheproof/keystore-cts/java/com/google/security/wycheproof/testcases/
DJsonEcdhTest.java126 KeyStore keyStore = KeyStoreUtil.saveKeysToKeystore(KEY_ALIAS_1, pubKey, privKey, in testEcdhComp() local
131 PrivateKey keyStorePrivateKey = (PrivateKey) keyStore.getKey(KEY_ALIAS_1, null); in testEcdhComp()
132 PublicKey publicKey = keyStore.getCertificate(KEY_ALIAS_1).getPublicKey(); in testEcdhComp()
DRsaEncryptionTest.java91 KeyStore keyStore = KeyStoreUtil.saveKeysToKeystore(KEY_ALIAS_SIG, pubKey, intermediateKey, in getPrivateKey() local
96 return (PrivateKey) keyStore.getKey(KEY_ALIAS_SIG, null); in getPrivateKey()
DJsonCipherTest.java88 KeyStore keyStore = KeyStoreUtil.saveSecretKeyToKeystore(KEY_ALIAS_1, keySpec, in initCipher() local
96 SecretKey keyStoreKey = (SecretKey) keyStore.getKey(KEY_ALIAS_1, null); in initCipher()

123