Home
last modified time | relevance | path

Searched refs:key (Results 1 – 25 of 343) sorted by relevance

12345678910>>...14

/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/
DSecretKeySpecTest.java44 byte[] key = new byte[] {1, 2, 3, 4, 5}; in testSecretKeySpec1()
62 new SecretKeySpec(key, null); in testSecretKeySpec1()
68 SecretKeySpec ks = new SecretKeySpec(key, algorithm); in testSecretKeySpec1()
69 key[0] ++; in testSecretKeySpec1()
72 key[0] == ks.getEncoded()[0]); in testSecretKeySpec1()
82 byte[] key = new byte[] {1, 2, 3, 4, 5}; in testSecretKeySpec2()
102 new SecretKeySpec(key, offset, len, null); in testSecretKeySpec2()
109 new SecretKeySpec(key, offset, key.length, algorithm); in testSecretKeySpec2()
116 new SecretKeySpec(key, 0, -1, algorithm); in testSecretKeySpec2()
124 SecretKeySpec ks = new SecretKeySpec(key, algorithm); in testSecretKeySpec2()
[all …]
/libcore/ojluni/src/main/java/javax/crypto/spec/
DDESKeySpec.java44 private byte[] key; field in DESKeySpec
130 public DESKeySpec(byte[] key) throws InvalidKeyException { in DESKeySpec() argument
131 this(key, 0); in DESKeySpec()
153 public DESKeySpec(byte[] key, int offset) throws InvalidKeyException { in DESKeySpec() argument
154 if (key.length - offset < DES_KEY_LEN) { in DESKeySpec()
157 this.key = new byte[DES_KEY_LEN]; in DESKeySpec()
158 System.arraycopy(key, offset, this.key, 0, DES_KEY_LEN); in DESKeySpec()
168 return this.key.clone(); in getKey()
186 public static boolean isParityAdjusted(byte[] key, int offset) in isParityAdjusted() argument
188 if (key == null) { in isParityAdjusted()
[all …]
DDESedeKeySpec.java44 private byte[] key; field in DESedeKeySpec
61 public DESedeKeySpec(byte[] key) throws InvalidKeyException { in DESedeKeySpec() argument
62 this(key, 0); in DESedeKeySpec()
83 public DESedeKeySpec(byte[] key, int offset) throws InvalidKeyException { in DESedeKeySpec() argument
84 if (key.length - offset < 24) { in DESedeKeySpec()
87 this.key = new byte[24]; in DESedeKeySpec()
88 System.arraycopy(key, offset, this.key, 0, 24); in DESedeKeySpec()
98 return this.key.clone(); in getKey()
114 public static boolean isParityAdjusted(byte[] key, int offset) in isParityAdjusted() argument
116 if (key.length - offset < 24) { in isParityAdjusted()
[all …]
DSecretKeySpec.java59 private byte[] key; field in SecretKeySpec
91 public SecretKeySpec(byte[] key, String algorithm) { in SecretKeySpec() argument
92 if (key == null || algorithm == null) { in SecretKeySpec()
95 if (key.length == 0) { in SecretKeySpec()
98 this.key = key.clone(); in SecretKeySpec()
140 public SecretKeySpec(byte[] key, int offset, int len, String algorithm) { in SecretKeySpec() argument
141 if (key == null || algorithm == null) { in SecretKeySpec()
144 if (key.length == 0) { in SecretKeySpec()
147 if (key.length-offset < len) { in SecretKeySpec()
154 this.key = new byte[len]; in SecretKeySpec()
[all …]
/libcore/ojluni/src/main/java/sun/util/locale/
DLocaleObjectCache.java51 public V get(K key) { in get() argument
55 CacheEntry<K, V> entry = map.get(key); in get()
60 V newVal = createObject(key); in get()
63 key = normalizeKey(key); in get()
64 if (key == null || newVal == null) { in get()
69 CacheEntry<K, V> newEntry = new CacheEntry<>(key, newVal, queue); in get()
71 entry = map.putIfAbsent(key, newEntry); in get()
77 map.put(key, newEntry); in get()
85 protected V put(K key, V value) { in put() argument
86 CacheEntry<K, V> entry = new CacheEntry<>(key, value, queue); in put()
[all …]
DExtension.java36 private final char key; field in Extension
39 protected Extension(char key) { in Extension() argument
40 this.key = key; in Extension()
43 Extension(char key, String value) { in Extension() argument
44 this.key = key; in Extension()
50 this.id = key + LanguageTag.SEP + value; in setValue()
54 return key; in getKey()
/libcore/luni/src/test/java/libcore/java/nio/channels/
DMembershipKeyTest.java36 private MembershipKey key; field in MembershipKeyTest
50 key = client.join(MULTICAST_ADDRESS, NETWORK_INTERFACE, sourceAddress); in init()
52 key = client.join(MULTICAST_ADDRESS, NETWORK_INTERFACE); in init()
59 key = null; in tearDown()
73 assertTrue(key.isValid()); in check_isValid()
75 assertFalse(key.isValid()); in check_isValid()
89 assertTrue(key.isValid()); in check_isValid_OnDrop()
90 key.drop(); in check_isValid_OnDrop()
91 assertFalse(key.isValid()); in check_isValid_OnDrop()
105 key.drop(); in check_drop()
[all …]
/libcore/ojluni/src/main/java/java/util/concurrent/
DConcurrentMap.java88 default V getOrDefault(Object key, V defaultValue) { in getOrDefault() argument
90 return ((v = get(key)) != null) ? v : defaultValue; in getOrDefault()
159 V putIfAbsent(K key, V value); in putIfAbsent() argument
190 boolean remove(Object key, Object value); in remove() argument
222 boolean replace(K key, V oldValue, V newValue); in replace() argument
254 V replace(K key, V value); in replace() argument
327 default V computeIfAbsent(K key, in computeIfAbsent() argument
331 return ((oldValue = get(key)) == null in computeIfAbsent()
332 && (newValue = mappingFunction.apply(key)) != null in computeIfAbsent()
333 && (oldValue = putIfAbsent(key, newValue)) == null) in computeIfAbsent()
[all …]
/libcore/ojluni/src/main/java/java/security/
DProvider.java327 public synchronized Object put(Object key, Object value) { in put() argument
331 key + "/" + value +"]"); in put()
333 return implPut(key, value); in put()
354 public synchronized Object putIfAbsent(Object key, Object value) { in putIfAbsent() argument
358 key + "/" + value +"]"); in putIfAbsent()
360 return implPutIfAbsent(key, value); in putIfAbsent()
380 public synchronized Object remove(Object key) { in remove() argument
383 debug.println("Remove " + name + " provider property " + key); in remove()
385 return implRemove(key); in remove()
405 public synchronized boolean remove(Object key, Object value) { in remove() argument
[all …]
/libcore/ojluni/src/main/java/sun/nio/fs/
DAbstractWatchService.java71 final void enqueueKey(WatchKey key) { in enqueueKey() argument
72 pendingKeys.offer(key); in enqueueKey()
87 private void checkKey(WatchKey key) { in checkKey() argument
88 if (key == CLOSE_KEY) { in checkKey()
90 enqueueKey(key); in checkKey()
98 WatchKey key = pendingKeys.poll(); in poll() local
99 checkKey(key); in poll()
100 return key; in poll()
108 WatchKey key = pendingKeys.poll(timeout, unit); in poll() local
109 checkKey(key); in poll()
[all …]
/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/
DExemptionMechanismSpiTest.java66 protected void engineInit(Key key) throws InvalidKeyException, ExemptionMechanismException { in engineInit() argument
67 super.engineInit(key); in engineInit()
72 …protected void engineInit(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, Inva… in engineInit() argument
73 super.engineInit(key, params); in engineInit()
78 …protected void engineInit(Key key, AlgorithmParameters params) throws InvalidKeyException, Invalid… in engineInit() argument
79 super.engineInit(key, params); in engineInit()
98 Key key = null; in testExemptionMechanismSpi01() local
102 emSpi.engineInit(key); in testExemptionMechanismSpi01()
107 emSpi.engineInit(key, params); in testExemptionMechanismSpi01()
112 emSpi.engineInit(key, parSpec); in testExemptionMechanismSpi01()
[all …]
DExemptionMechanismTest.java129 Key key = new MyExemptionMechanismSpi().new tmpKey("Proba", new byte[0]); in testIsCryptoAllowed() local
131 assertFalse(em.isCryptoAllowed(key)); in testIsCryptoAllowed()
133 em.init(key); in testIsCryptoAllowed()
134 assertFalse(em.isCryptoAllowed(key)); in testIsCryptoAllowed()
137 assertTrue(em.isCryptoAllowed(key)); in testIsCryptoAllowed()
144 assertFalse(em.isCryptoAllowed(key)); in testIsCryptoAllowed()
161 Key key = new MyExemptionMechanismSpi().new tmpKey("Proba", new byte[0]); in testGenExemptionBlob() local
163 em.init(key); in testGenExemptionBlob()
203 Key key = new MyExemptionMechanismSpi().new tmpKey("Proba", new byte[0]); in test_genExemptionBlob() local
212 em.init(key); in test_genExemptionBlob()
[all …]
/libcore/ojluni/src/main/java/sun/nio/ch/
DMembershipRegistry.java57 for (MembershipKeyImpl key: keys) { in checkMembership()
58 if (key.networkInterface().equals(interf)) { in checkMembership()
62 if (key.sourceAddress() == null) in checkMembership()
63 return key; in checkMembership()
69 if (key.sourceAddress() == null) in checkMembership()
71 if (source.equals(key.sourceAddress())) in checkMembership()
72 return key; in checkMembership()
83 void add(MembershipKeyImpl key) { in add() argument
84 InetAddress group = key.group(); in add()
96 keys.add(key); in add()
[all …]
/libcore/ojluni/src/main/java/java/util/
DAbstractMap.java143 public boolean containsKey(Object key) { in containsKey() argument
145 if (key==null) { in containsKey()
154 if (key.equals(e.getKey())) in containsKey()
175 public V get(Object key) { in get() argument
177 if (key==null) { in get()
186 if (key.equals(e.getKey())) in get()
208 public V put(K key, V value) { in put() argument
234 public V remove(Object key) { in remove() argument
237 if (key==null) { in remove()
246 if (key.equals(e.getKey())) in remove()
[all …]
DHashtable.java335 public synchronized boolean containsKey(Object key) { in containsKey() argument
337 int hash = key.hashCode(); in containsKey()
340 if ((e.hash == hash) && e.key.equals(key)) { in containsKey()
363 public synchronized V get(Object key) { in get() argument
365 int hash = key.hashCode(); in get()
368 if ((e.hash == hash) && e.key.equals(key)) { in get()
421 private void addEntry(int hash, K key, V value, int index) { in addEntry() argument
430 hash = key.hashCode(); in addEntry()
437 tab[index] = new HashtableEntry<>(hash, key, value, e); in addEntry()
458 public synchronized V put(K key, V value) { in put() argument
[all …]
DMissingResourceException.java60 public MissingResourceException(String s, String className, String key) { in MissingResourceException() argument
63 this.key = key; in MissingResourceException()
84 MissingResourceException(String message, String className, String key, Throwable cause) { in MissingResourceException() argument
87 this.key = key; in MissingResourceException()
105 return key; in getKey()
123 private String key; field in MissingResourceException
/libcore/ojluni/src/main/java/sun/security/util/
DKeyUtil.java51 public static final int getKeySize(Key key) { in getKeySize() argument
54 if (key instanceof Length) { in getKeySize()
56 Length ruler = (Length)key; in getKeySize()
68 if (key instanceof SecretKey) { in getKeySize()
69 SecretKey sk = (SecretKey)key; in getKeySize()
75 } else if (key instanceof RSAKey) { in getKeySize()
76 RSAKey pubk = (RSAKey)key; in getKeySize()
78 } else if (key instanceof ECKey) { in getKeySize()
79 ECKey pubk = (ECKey)key; in getKeySize()
92 } else if (key instanceof DSAKey) { in getKeySize()
[all …]
DCache.java91 public abstract void put(K key, V value); in put() argument
96 public abstract V get(Object key); in get() argument
101 public abstract void remove(Object key); in remove() argument
219 public void put(K key, V value) { in put() argument
223 public V get(Object key) { in get() argument
227 public void remove(Object key) { in remove() argument
294 K key = entry.getKey(); in emptyQueue() local
295 if (key == null) { in emptyQueue()
299 CacheEntry<K,V> currentEntry = cacheMap.remove(key); in emptyQueue()
303 cacheMap.put(key, currentEntry); in emptyQueue()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DTreeMapExtendTest.java141 String key = new Integer(100).toString(); in test_TreeMap_Constructor_Map() local
142 assertEquals(tm.ceilingKey(key), treeMap.ceilingKey(key)); in test_TreeMap_Constructor_Map()
143 assertEquals(tm.ceilingEntry(key), treeMap.ceilingEntry(key)); in test_TreeMap_Constructor_Map()
144 assertEquals(tm.floorKey(key), treeMap.floorKey(key)); in test_TreeMap_Constructor_Map()
145 assertEquals(tm.floorEntry(key), treeMap.floorEntry(key)); in test_TreeMap_Constructor_Map()
146 assertEquals(tm.lowerKey(key), treeMap.lowerKey(key)); in test_TreeMap_Constructor_Map()
147 assertEquals(tm.lowerEntry(key), treeMap.lowerEntry(key)); in test_TreeMap_Constructor_Map()
148 assertEquals(tm.higherKey(key), treeMap.higherKey(key)); in test_TreeMap_Constructor_Map()
149 assertEquals(tm.higherEntry(key), treeMap.higherEntry(key)); in test_TreeMap_Constructor_Map()
185 String key = null; in test_SubMap_containsKey() local
[all …]
/libcore/luni/src/main/java/libcore/util/
DBasicLruCache.java49 public final V get(K key) { in get() argument
50 if (key == null) { in get()
56 result = map.get(key); in get()
63 result = create(key); in get()
72 map.put(key, result); in get()
88 public synchronized final V put(K key, V value) { in put() argument
89 if (key == null) { in put()
95 V previous = map.put(key, value); in put()
104 K key = toEvict.getKey(); in trimToSize() local
106 map.remove(key); in trimToSize()
[all …]
/libcore/luni/src/test/java/libcore/javax/crypto/
DMockCipherSpi.java40 public void checkKeyType(Key key) throws InvalidKeyException { in checkKeyType() argument
41 if (!(key instanceof MockKey)) { in checkKeyType()
49 public void checkKeyType(Key key) throws InvalidKeyException { in checkKeyType() argument
50 System.err.println("Checking key of type " + key.getClass().getName()); in checkKeyType()
51 if (!(key instanceof MockKey2)) { in checkKeyType()
104 protected void engineInit(int opmode, Key key, SecureRandom random) in engineInit() argument
110 protected void engineInit(int opmode, Key key, AlgorithmParameterSpec params, in engineInit() argument
116 protected void engineInit(int opmode, Key key, AlgorithmParameters params, in engineInit() argument
124 protected void engineInit(int opmode, Key key, SecureRandom random) in engineInit() argument
130 protected void engineInit(int opmode, Key key, AlgorithmParameterSpec params, in engineInit() argument
[all …]
DMockKeyAgreementSpi.java35 public void checkKeyType(Key key) throws InvalidKeyException { in checkKeyType() argument
36 if (!(key instanceof MockKey)) { in checkKeyType()
44 public void checkKeyType(Key key) throws InvalidKeyException { in checkKeyType() argument
45 System.err.println("Checking key of type " + key.getClass().getName()); in checkKeyType()
46 if (!(key instanceof MockKey2)) { in checkKeyType()
55 public void checkKeyType(Key key) throws InvalidKeyException { in checkKeyType() argument
59 protected Key engineDoPhase(Key key, boolean lastPhase) throws InvalidKeyException, in engineDoPhase() argument
82 protected void engineInit(Key key, SecureRandom random) throws InvalidKeyException { in engineInit() argument
83 checkKeyType(key); in engineInit()
87 protected void engineInit(Key key, AlgorithmParameterSpec params, SecureRandom random) in engineInit() argument
[all …]
/libcore/support/src/test/java/org/apache/harmony/security/tests/support/
DSystemScope.java92 public synchronized Identity getIdentity(PublicKey key) { in getIdentity() argument
93 if (key == null) { in getIdentity()
96 return (Identity) keys.get(key); in getIdentity()
112 PublicKey key = identity.getPublicKey(); in addIdentity() local
113 if (key != null && keys.containsKey(key)) { in addIdentity()
114 throw new KeyManagementException("key '" + key + "' is already used"); in addIdentity()
118 if (key != null) { in addIdentity()
119 keys.put(key, identity); in addIdentity()
142 PublicKey key = identity.getPublicKey(); in removeIdentity() local
144 if (key != null) { in removeIdentity()
[all …]
/libcore/ojluni/src/main/java/javax/crypto/
DKeyAgreement.java372 private void implInit(KeyAgreementSpi spi, int type, Key key, in implInit() argument
376 spi.engineInit(key, random); in implInit()
378 spi.engineInit(key, params, random); in implInit()
382 private void chooseProvider(int initType, Key key, in chooseProvider() argument
388 if (spi != null && key == null) { in chooseProvider()
389 implInit(spi, initType, key, params, random); in chooseProvider()
396 if (s.supportsParameter(key) == false) { in chooseProvider()
404 implInit(spi, initType, key, params, random); in chooseProvider()
432 String kName = (key != null) ? key.getClass().getName() : "(null)"; in chooseProvider()
469 public final void init(Key key) throws InvalidKeyException { in init() argument
[all …]
/libcore/ojluni/src/main/java/sun/security/x509/
DCertificateX509Key.java56 private PublicKey key; field in CertificateX509Key
63 public CertificateX509Key(PublicKey key) { in CertificateX509Key() argument
64 this.key = key; in CertificateX509Key()
75 key = X509Key.parse(val); in CertificateX509Key()
86 key = X509Key.parse(val); in CertificateX509Key()
93 if (key == null) return ""; in toString()
94 return(key.toString()); in toString()
105 tmp.write(key.getEncoded()); in encode()
115 this.key = (PublicKey)obj; in set()
127 return(key); in get()
[all …]

12345678910>>...14