protected X509Credential loadPKCS12Credential(String pkcs12FilePath,
    PasswordFinder pf) {

    KeystoreCredential cred = null;

    listener.notifyCredentialLookup(pkcs12FilePath);

    if (fileExistsAndIsReadable(pkcs12FilePath)) {

      char[] keyPassword = pf.getPassword();
      try {

        FilePermissionHelper.checkPKCS12Permissions(pkcs12FilePath);

        cred = new KeystoreCredential(pkcs12FilePath, keyPassword, keyPassword,
          null, "PKCS12");
        listener.notifyLoadCredentialSuccess(pkcs12FilePath);

      } catch (Throwable t) {

        listener.notifyLoadCredentialFailure(t, pkcs12FilePath);
      }

    } else
      listener.notifyLoadCredentialFailure(new FileNotFoundException(
        pkcs12FilePath + " (cannot read file)"), pkcs12FilePath);

    return cred;
  }
protected X509Credential loadPKCS12Credential ( String pkcs12FilePath , PasswordFinder pf ) { KeystoreCredential cred = null ; listener . notifyCredentialLookup ( pkcs12FilePath ) ; if ( fileExistsAndIsReadable ( pkcs12FilePath ) ) { char [ ] keyPassword = pf . getPassword ( ) ; try { FilePermissionHelper . checkPKCS12Permissions ( pkcs12FilePath ) ; cred = new KeystoreCredential ( pkcs12FilePath , keyPassword , keyPassword , null , "PKCS12" ) ; listener . notifyLoadCredentialSuccess ( pkcs12FilePath ) ; } catch ( Throwable t ) { listener . notifyLoadCredentialFailure ( t , pkcs12FilePath ) ; } } else listener . notifyLoadCredentialFailure ( new FileNotFoundException ( pkcs12FilePath + " (cannot read file)" ) , pkcs12FilePath ) ; return cred ; }
Loads a PCKS12 X.509 credential and notifies the registered
{@link LoadCredentialsEventListener} of the load operation outcome.

@param pkcs12FilePath
the path to the pkcs12 credential
@param pf
a {@link PasswordFinder} used to resolve the private key password
@return the loaded {@link X509Credential}, or <code>null</code> if the
credential couldn't be loaded