Esempio n. 1
0
 /**
  * gets the matching public entry for a private one.
  *
  * @return the {@link KeyStoreAlias} for the public key
  */
 private KeyStoreAlias getPublicForPrivate() {
   Enumeration<String> aliases = ksm.getAliases();
   KeyStoreAlias alias;
   while (aliases != null && aliases.hasMoreElements()) {
     alias = new KeyStoreAlias(aliases.nextElement());
     if (alias.getHashValue().equalsIgnoreCase(privateAlias.getHashValue())
         && alias != privateAlias) return alias;
   }
   return null;
 }
Esempio n. 2
0
 /** initializes the keystore connection and adds all matching keys to the key selection list */
 private void initKeystoreConnection() {
   ksm = KeyStoreManager.getInstance();
   KeyStoreAlias alias;
   for (Enumeration<String> aliases = ksm.getAliases(); aliases.hasMoreElements(); ) {
     alias = new KeyStoreAlias(aliases.nextElement());
     if (alias.getClassName().equals(RSAPrivateCrtKey.class.getName())) {
       keyStoreItems.put(
           alias.getContactName()
               + " - "
               + alias.getKeyLength()
               + "Bit - " //$NON-NLS-1$ //$NON-NLS-2$
               + alias.getClassName(),
           alias);
     }
   }
 }
Esempio n. 3
0
 /** checks whether this page is already complete. */
 private void checkComplete() {
   boolean complete = privateAlias != null && !passfield.getText().equals(""); // $NON-NLS-1$
   if (complete) {
     data.setPrivateAlias(privateAlias);
     data.setPublicAlias(publicAlias);
     data.setContactName(privateAlias.getContactName());
     data.setPassword(passfield.getText());
   }
   setPageComplete(complete);
 }