Home
last modified time | relevance | path

Searched refs:keys (Results 1 – 25 of 63) sorted by relevance

123

/libcore/luni/src/main/java/java/io/
DSerializationHandleMap.java28 private Object[] keys; field in SerializationHandleMap
45 Object[] oldKeys = keys; in resizeArrays()
48 this.keys = new Object[newSize]; in resizeArrays()
55 int index = findIndex(key, keys); in resizeArrays()
56 keys[index] = key; in resizeArrays()
63 int index = findIndex(key, keys); in get()
64 if (keys[index] == key) { in get()
99 int index = findIndex(_key, keys); in put()
102 if (keys[index] != _key) { in put()
105 index = findIndex(_key, keys); in put()
[all …]
/libcore/support/src/test/java/tests/security/
DDefaultKeys.java185 private static final HashMap<String, KeySpec> keys = new HashMap<String, KeySpec>(); field in DefaultKeys
187 keys.put("DH_public", new X509EncodedKeySpec(DH_public));
188 keys.put("DH_private", new PKCS8EncodedKeySpec(DH_private));
189 keys.put("DSA_public", new X509EncodedKeySpec(DSA_public));
190 keys.put("DSA_private", new PKCS8EncodedKeySpec(DSA_private));
191 keys.put("RSA_public", new X509EncodedKeySpec(RSA_public));
192 keys.put("RSA_private", new PKCS8EncodedKeySpec(RSA_private));
198 return factory.generatePrivate(keys.get(algorithmName + "_private")); in getPrivateKey()
204 return factory.generatePublic(keys.get(algorithmName + "_public")); in getPublicKey()
/libcore/luni/src/test/java/tests/security/interfaces/
DDSAPublicKeyTest.java39 KeyPair keys = null; in test_getY() local
48 keys = keyGen.generateKeyPair(); in test_getY()
49 priv = (DSAPrivateKey) keys.getPrivate(); in test_getY()
50 publ = (DSAPublicKey) keys.getPublic(); in test_getY()
56 keys = keyGen.generateKeyPair(); in test_getY()
57 priv = (DSAPrivateKey) keys.getPrivate(); in test_getY()
58 publ = (DSAPublicKey) keys.getPublic(); in test_getY()
/libcore/luni/src/main/java/org/apache/harmony/security/x509/
DExtendedKeyUsage.java46 private List<String> keys; field in ExtendedKeyUsage
60 if (keys == null) { in getExtendedKeyUsage()
61 keys = (List<String>) ASN1.decode(getEncoded()); in getExtendedKeyUsage()
63 return keys; in getExtendedKeyUsage()
68 encoding = ASN1.encode(keys); in getEncoded()
75 if (keys == null) { in dumpValue()
77 keys = getExtendedKeyUsage(); in dumpValue()
85 for (Iterator<?> it = keys.iterator(); it.hasNext();) { in dumpValue()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DListResourceBundleTest.java35 Enumeration<String> keys = bundle.getKeys(); in test_getKeys() local
37 while (keys.hasMoreElements()) { in test_getKeys()
38 result.addElement(keys.nextElement()); in test_getKeys()
54 Enumeration keys = bundle.getKeys(); in test_handleGetObjectLjava_lang_String() local
57 while (keys.hasMoreElements()) { in test_handleGetObjectLjava_lang_String()
58 result.addElement(bundle.handleGetObject((String)keys.nextElement())); in test_handleGetObjectLjava_lang_String()
DWeakHashMapTest.java185 List keys = Arrays.asList(keyArray); in test_entrySet() local
193 assertTrue("Invalid map entry returned--bad key", keys in test_entrySet()
198 keys = null; in test_entrySet()
300 List keys = Arrays.asList(keyArray); in test_keySet() local
308 assertTrue("Invalid map entry returned--bad key", keys in test_keySet()
311 keys = null; in test_keySet()
377 List keys = Arrays.asList(keyArray); in test_values() local
389 keys = null; in test_values()
DHashtableTest.java144 Enumeration keys = h.keys(); in test_clear() local
146 && !(keys.hasMoreElements())); in test_clear()
159 Enumeration org = htfull.keys(); in test_clone()
160 Enumeration cpy = h.keys(); in test_clone()
422 Enumeration keys = ht10.keys(); in test_keys() local
424 while (keys.hasMoreElements()) { in test_keys()
425 String s = (String) keys.nextElement(); in test_keys()
432 assertFalse(keys.hasMoreElements()); in test_keys()
434 keys.nextElement(); in test_keys()
448 Enumeration en = ht.keys(); in test_keys_subtest0()
[all …]
/libcore/luni/src/main/java/org/apache/harmony/security/
DSystemScope.java47 private Hashtable keys = new Hashtable(); field in SystemScope
94 return (Identity) keys.get(key); in getIdentity()
111 if (key != null && keys.containsKey(key)) { in addIdentity()
117 keys.put(key, identity); in addIdentity()
143 contains = contains || keys.containsKey(key); in removeIdentity()
144 keys.remove(key); in removeIdentity()
/libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/
DKeyFactory2Test.java117 KeyPair keys = keyGen.generateKeyPair(); in test_generatePrivateLjava_security_spec_KeySpec() local
122 KeySpec privateKeySpec = fact.getKeySpec(keys.getPrivate(), in test_generatePrivateLjava_security_spec_KeySpec()
126 Arrays.toString(keys.getPrivate().getEncoded()), in test_generatePrivateLjava_security_spec_KeySpec()
128 … privateKey = fact.generatePrivate(new PKCS8EncodedKeySpec(keys.getPrivate().getEncoded())); in test_generatePrivateLjava_security_spec_KeySpec()
130 Arrays.toString(keys.getPrivate().getEncoded()), in test_generatePrivateLjava_security_spec_KeySpec()
147 KeyPair keys = keyGen.generateKeyPair(); in test_generatePublicLjava_security_spec_KeySpec() local
151 KeySpec publicKeySpec = fact.getKeySpec(keys.getPublic(), in test_generatePublicLjava_security_spec_KeySpec()
158 Arrays.toString(keys.getPublic().getEncoded()), in test_generatePublicLjava_security_spec_KeySpec()
239 KeyPair keys = keyGen.generateKeyPair(); in test_getKeySpecLjava_security_KeyLjava_lang_Class() local
243 KeySpec privateKeySpec = fact.getKeySpec(keys.getPrivate(), in test_getKeySpecLjava_security_KeyLjava_lang_Class()
[all …]
DKeyPairGenerator1Test.java349 int[] keys = { -10000, -1024, -1, 0, 10000 }; in testKeyPairGenerator11() local
357 for (int j = 0; j < keys.length; j++) { in testKeyPairGenerator11()
359 kpg[i].initialize(keys[j]); in testKeyPairGenerator11()
360 kpg[i].initialize(keys[j], random); in testKeyPairGenerator11()
386 int[] keys = { -1, -250, 1, 64, 512, 1024 }; in testKeyPairGenerator12() local
396 for (int i = 0; i < keys.length; i++) { in testKeyPairGenerator12()
398 mKPG.initialize(keys[i]); in testKeyPairGenerator12()
400 + Integer.toString(keys[i]) + ")"); in testKeyPairGenerator12()
404 mKPG.initialize(keys[i], random); in testKeyPairGenerator12()
406 + Integer.toString(keys[i]) + ")"); in testKeyPairGenerator12()
[all …]
DKeyFactoryTest.java286 Key[] keys = { in testGetKeySpec() local
300 for (int i = 0; i < keys.length; i++) { in testGetKeySpec()
301 Key key = keys[i]; in testGetKeySpec()
315 Key[] keys = { in testGetKeySpec() local
336 for (int i = 0; i < keys.length; i++) { in testGetKeySpec()
337 Key key = keys[i]; in testGetKeySpec()
368 Key[] keys = { in testTranslateKey() local
378 for (int i = 0; i < keys.length; i++) { in testTranslateKey()
379 Key key = keys[i]; in testTranslateKey()
392 Key[] keys = { in testTranslateKey() local
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/
DX509KeyManagerTest.java32 private PrivateKey[] keys; field in X509KeyManagerTest
631 keys = new PrivateKey[3]; in init()
632 keys[0] = kf.generatePrivate(new PKCS8EncodedKeySpec(keyBytes)); in init()
633 keys[1] = kf.generatePrivate(new PKCS8EncodedKeySpec(key2Bytes)); in init()
634 keys[2] = kf.generatePrivate(new PKCS8EncodedKeySpec(key3Bytes)); in init()
639 … keyTest.setKeyEntry("clientKey_01", keys[0], PASSWORD, new X509Certificate[] {cert[0]}); in init()
640 … keyTest.setKeyEntry("clientKey_02", keys[1], PASSWORD, new X509Certificate[] {cert[0], cert[1]}); in init()
641 … keyTest.setKeyEntry("clientKey_03", keys[2], PASSWORD, new X509Certificate[] {cert[0], cert[2]}); in init()
646 keys = new PrivateKey[1]; in init()
647 keys[0] = kf.generatePrivate(new PKCS8EncodedKeySpec(keyBytes)); in init()
[all …]
DSSLSessionTest.java490 String keys; field in SSLSessionTest.TestServer
498 public TestServer(boolean provideKeys, int clientAuth, String keys) throws Exception { in TestServer() argument
499 this.keys = keys; in TestServer()
505 store = provideKeys ? getKeyStore(keys) : null; in TestServer()
573 private String keys; field in SSLSessionTest.TestClient
579 public TestClient(boolean provideKeys, String keys) { in TestClient() argument
580 this.keys = keys; in TestClient()
588 store = provideKeys ? getKeyStore(keys) : null; in run()
634 private KeyStore getKeyStore(String keys) throws Exception { in getKeyStore() argument
635 byte[] bytes = Base64.decode(keys.getBytes()); in getKeyStore()
DHandshakeCompletedEventTest.java393 String keys; field in HandshakeCompletedEventTest.TestServer
399 public TestServer(boolean provideKeys, int clientAuth, String keys) throws Exception { in TestServer() argument
400 this.keys = keys; in TestServer()
406 KeyManager[] keyManagers = provideKeys ? getKeyManagers(keys) : null; in TestServer()
476 private String keys; field in HandshakeCompletedEventTest.TestClient
480 public TestClient(boolean provideKeys, String keys) { in TestClient() argument
481 this.keys = keys; in TestClient()
489 KeyManager[] keyManagers = provideKeys ? getKeyManagers(keys) : null; in run()
539 private KeyManager[] getKeyManagers(String keys) throws Exception { in getKeyManagers() argument
540 byte[] bytes = Base64.decode(keys.getBytes()); in getKeyManagers()
DSSLSocketTest.java485 String keys = useBKS ? SERVER_KEYS_BKS : SERVER_KEYS_JKS; in startServer() local
486 TestServer server = new TestServer(true, keys); in startServer()
521 String keys; field in SSLSocketTest.TestServer
527 public TestServer(boolean provideKeys, String keys) { in TestServer() argument
528 this.keys = keys; in TestServer()
536 KeyManager[] keyManagers = provideKeys ? getKeyManagers(keys) : null; in run()
589 private KeyManager[] getKeyManagers(String keys) throws Exception { in getKeyManagers() argument
590 byte[] bytes = Base64.decode(keys.getBytes()); in getKeyManagers()
/libcore/luni/src/test/java/tests/security/spec/
DEncodedKeySpec2Test.java42 KeyPair keys = keyGen.generateKeyPair(); in test_getEncoded() local
49 byte[] encoded = keys.getPublic().getEncoded(); in test_getEncoded()
53 isEqual(key, keys.getPublic())); in test_getEncoded()
56 encoded = keys.getPrivate().getEncoded(); in test_getEncoded()
60 isEqual(key, keys.getPrivate())); in test_getEncoded()
/libcore/json/src/test/java/org/json/
DJSONArrayTest.java325 JSONArray keys = new JSONArray(); in testToJSONObject() local
326 keys.put("a"); in testToJSONObject()
327 keys.put("b"); in testToJSONObject()
333 JSONObject object = values.toJSONObject(keys); in testToJSONObject()
337 keys.put(0, "a"); in testToJSONObject()
343 JSONArray keys = new JSONArray(); in testToJSONObjectWithNulls() local
344 keys.put("a"); in testToJSONObjectWithNulls()
345 keys.put("b"); in testToJSONObjectWithNulls()
352 JSONObject object = values.toJSONObject(keys); in testToJSONObjectWithNulls()
359 JSONArray keys = new JSONArray(); in testToJSONObjectMoreNamesThanValues() local
[all …]
/libcore/luni/src/main/java/java/util/
DEnumMap.java39 transient Enum[] keys; field in EnumMap
87 return (enumMap.keys[ordinal] == null ? 0 : enumMap.keys[ordinal] in hashCode()
97 return (KT) enumMap.keys[ordinal]; in getKey()
111 return enumMap.put((KT) enumMap.keys[ordinal], value); in setValue()
116 StringBuilder result = new StringBuilder(enumMap.keys[ordinal] in toString()
162 return type.get(new MapEntry(enumMap.keys[prePosition], in next()
169 enumMap.remove(enumMap.keys[prePosition]); in remove()
181 new MapEntry(enumMap.keys[prePosition], in toString()
271 enumMap.remove(enumMap.keys[i]);
279 enumMap.remove(enumMap.keys[i]);
[all …]
DProperties.java210 Enumeration<?> keys = propertyNames(); in listToAppendable() local
211 while (keys.hasMoreElements()) { in listToAppendable()
212 String key = (String) keys.nextElement(); in listToAppendable()
445 return selected.keys(); in propertyNames()
465 Enumeration<Object> keys = keys(); in selectProperties() local
466 while (keys.hasMoreElements()) { in selectProperties()
468 K key = (K) keys.nextElement(); in selectProperties()
/libcore/luni/src/main/java/java/util/prefs/
DXMLParser.java212 String[] keys = prefs.keys(); in exportEntries() local
213 String[] values = new String[keys.length]; in exportEntries()
214 for (int i = 0; i < keys.length; i++) { in exportEntries()
215 values[i] = prefs.get(keys[i], null); in exportEntries()
217 exportEntries(keys, values, out); in exportEntries()
220 private static void exportEntries(String[] keys, String[] values, in exportEntries() argument
222 if (keys.length == 0) { in exportEntries()
227 for (int i = 0; i < keys.length; i++) { in exportEntries()
230 new String[] { keys[i], values[i] }, out); in exportEntries()
488 String[] keys = properties.keySet().toArray(new String[properties.size()]); in writeXmlPreferences() local
[all …]
/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/
DCipherWrapThread.java26 CipherWrapThread(String name, int[] keys, String[] modes, String[] paddings) { in CipherWrapThread() argument
27 super(name, keys, modes, paddings); in CipherWrapThread()
DCipherRSAThread.java26 CipherRSAThread(String name, int[] keys, String[] modes, String[] paddings) { in CipherRSAThread() argument
27 super(name, keys, modes, paddings); in CipherRSAThread()
DCipherPBEThread.java30 CipherPBEThread(String name, int[] keys, String[] modes, String[] paddings) { in CipherPBEThread() argument
31 super(name, keys, modes, paddings); in CipherPBEThread()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/
DSelectorTest.java107 Set<SelectionKey> keySet = selector.keys(); in test_keys()
108 Set<SelectionKey> keySet2 = selector.keys(); in test_keys()
140 selector.keys(); in test_keys()
331 Set<SelectionKey> keys = selector.keys();
335 assertTrue(keys.contains(key1));
341 assertTrue(keys.contains(key1));
342 assertTrue(keys.contains(key2));
345 assertTrue(keys.contains(key1));
348 assertFalse(keys.contains(key1));
349 assertTrue(keys.contains(key2));
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/prefs/
DFilePreferencesImplTest.java53 String[] names = uroot.keys(); in testPutGet()
60 names = uroot.keys(); in testPutGet()
65 names = uroot.keys(); in testPutGet()

123