Lines Matching +refs:val +refs:entry
57 Date date; // the creation date of this entry
67 Date date; // the creation date of this entry
140 * or does not identify a <i>key entry</i>.
152 Object entry = entries.get(alias.toLowerCase());
154 if (entry == null || !(entry instanceof KeyEntry)) {
159 byte[] exportedKeyInfo = _getEncodedKeyData(((KeyEntry)entry).keyRef, password);
177 DerValue val = new DerValue(encrInfo.getAlgorithm().encode());
178 DerInputStream in = val.toDerInputStream();
198 DerValue val = new DerValue(decryptedPrivateKey);
199 DerInputStream in = val.toDerInputStream();
233 * alias identifies either a <i>trusted certificate entry</i> or a
234 * <i>key entry</i> without a certificate chain).
239 Object entry = entries.get(alias.toLowerCase());
241 if (entry != null && entry instanceof KeyEntry) {
242 if (((KeyEntry)entry).chain == null) {
245 return (Certificate[])((KeyEntry)entry).chain.clone();
256 * <i>trusted certificate entry</i>, the certificate associated with that
257 * entry is returned. If the given alias name identifies a
258 * <i>key entry</i>, the first element of the certificate chain of that
259 * entry is returned, or null if that entry does not have a certificate
270 Object entry = entries.get(alias.toLowerCase());
272 if (entry != null) {
273 if (entry instanceof TrustedCertEntry) {
274 return ((TrustedCertEntry)entry).cert;
276 if (((KeyEntry)entry).chain == null) {
279 return ((KeyEntry)entry).chain[0];
288 * Returns the creation date of the entry identified by the given alias.
292 * @return the creation date of this entry, or null if the given alias does
298 Object entry = entries.get(alias.toLowerCase());
300 if (entry != null) {
301 if (entry instanceof TrustedCertEntry) {
302 return new Date(((TrustedCertEntry)entry).date.getTime());
304 return new Date(((KeyEntry)entry).date.getTime());
341 KeyEntry entry = new KeyEntry();
342 entry.date = new Date();
347 entry.protectedPrivKey = encryptPrivateKey(key.getEncoded(), password);
348 entry.password = password.clone();
362 entry.chain = (Certificate[])chain.clone();
363 entry.chainRefs = new long[entry.chain.length];
371 entries.put(lowerAlias, entry);
372 addedEntries.put(lowerAlias, entry);
413 KeyEntry entry = new KeyEntry();
416 entry.protectedPrivKey = privateKey.getEncoded();
422 entry.date = new Date();
426 entry.chain = (Certificate[])chain.clone();
427 entry.chainRefs = new long[entry.chain.length];
434 entries.put(lowerAlias, entry);
435 addedEntries.put(lowerAlias, entry);
443 * <i>trusted certificate entry</i>, the certificate associated with it is
450 * not identify a <i>trusted certificate entry</i>, or this operation
460 Object entry = entries.get(alias.toLowerCase());
461 if ((entry != null) && (entry instanceof KeyEntry)) {
463 ("Cannot overwrite key entry with certificate");
466 // This will be slow, but necessary. Enumerate the values and then see if the cert matches the one in the trusted cert entry.
492 * Deletes the entry identified by the given alias from this keystore.
496 * @exception KeyStoreException if the entry cannot be removed.
504 Object entry = entries.remove(alias.toLowerCase());
505 deletedEntries.put(alias.toLowerCase(), entry);
542 * Returns true if the entry identified by the given alias is a
543 * <i>key entry</i>, and false otherwise.
545 * @return true if the entry identified by the given alias is a
546 * <i>key entry</i>, false otherwise.
550 Object entry = entries.get(alias.toLowerCase());
551 if ((entry != null) && (entry instanceof KeyEntry)) {
559 * Returns true if the entry identified by the given alias is a
560 * <i>trusted certificate entry</i>, and false otherwise.
562 * @return true if the entry identified by the given alias is a
563 * <i>trusted certificate entry</i>, false otherwise.
567 Object entry = entries.get(alias.toLowerCase());
568 if ((entry != null) && (entry instanceof TrustedCertEntry)) {
576 * Returns the (alias) name of the first keystore entry whose certificate
580 * keystore entry. If the entry being considered
581 * is a <i>trusted certificate entry</i>, the given certificate is
582 * compared to that entry's certificate. If the entry being considered is
583 * a <i>key entry</i>, the given certificate is compared to the first
584 * element of that entry's certificate chain (if a chain exists).
588 * @return the (alias) name of the first entry with matching certificate,
589 * or null if no such entry exists in this keystore.
597 Object entry = entries.get(alias);
598 if (entry instanceof TrustedCertEntry) {
599 certElem = ((TrustedCertEntry)entry).cert;
600 } else if (((KeyEntry)entry).chain != null) {
601 certElem = ((KeyEntry)entry).chain[0];
633 Object entry = deletedEntries.get(alias);
634 if (entry instanceof TrustedCertEntry) {
635 if (((TrustedCertEntry)entry).certRef != 0) {
636 _removeItemFromKeychain(((TrustedCertEntry)entry).certRef);
637 _releaseKeychainItemRef(((TrustedCertEntry)entry).certRef);
641 KeyEntry keyEntry = (KeyEntry)entry;
663 Object entry = addedEntries.get(alias);
664 if (entry instanceof TrustedCertEntry) {
665 TrustedCertEntry tce = (TrustedCertEntry)entry;
670 KeyEntry keyEntry = (KeyEntry)entry;
729 Object entry = entries.get(alias);
730 if (entry instanceof TrustedCertEntry) {
731 if (((TrustedCertEntry)entry).certRef != 0) {
732 _releaseKeychainItemRef(((TrustedCertEntry)entry).certRef);
735 KeyEntry keyEntry = (KeyEntry)entry;
894 DerValue val = new DerValue(new ByteArrayInputStream(privateKeyInfo));
895 DerInputStream s = val.toDerInputStream();