Esempio n. 1
0
 public X509Certificate[] getCertificateChain(String alias) {
   X509Certificate[] certArray = keyManager.getCertificateChain(alias);
   if (Debug.verboseOn())
     Debug.logVerbose(
         "getCertificateChain for alias [" + alias + "] got " + certArray.length + " results",
         module);
   return certArray;
 }
Esempio n. 2
0
 public PrivateKey getPrivateKey(String alias) {
   PrivateKey pk = keyManager.getPrivateKey(alias);
   if (Debug.verboseOn())
     Debug.logVerbose(
         "getPrivateKey for alias ["
             + alias
             + "] got "
             + (pk == null
                 ? "[Not Found!]"
                 : "[alg:" + pk.getAlgorithm() + ";format:" + pk.getFormat() + "]"),
         module);
   // Debug.logInfo(new Exception(), "Location where getPrivateKey is called", module);
   return pk;
 }
Esempio n. 3
0
 // this is where the customization comes in
 public String chooseClientAlias(String[] keyTypes, Principal[] issuers, Socket socket) {
   for (String keyType : keyTypes) {
     String[] aliases = keyManager.getClientAliases(keyType, null); // ignoring the issuers
     if (aliases != null && aliases.length > 0) {
       for (String alias : aliases) {
         if (this.alias.equals(alias)) {
           if (Debug.verboseOn())
             Debug.logVerbose(
                 "chooseClientAlias for keyType [" + keyType + "] got alias " + this.alias,
                 module);
           // Debug.logInfo(new Exception(), "Location where chooseClientAlias is called", module);
           return this.alias;
         }
       }
     }
   }
   return null;
 }