gerrit-events/src/main/java/com/sonyericsson/hudson/plugins/gerrit/gerritevents/ssh/SshUtil.java
/**
     * Checks to see if the passPhrase is valid for the private key file.
     * @param keyFilePath the private key file.
     * @param passPhrase the password for the file.
     * @return true if it is valid.
     */
Checks to see if the passPhrase is valid for the private key file.
@param keyFilePath the private key file.
@param passPhrase the password for the file.
@return true if it is valid.
Checks to see if the passPhrase is valid for the private key file . @param keyFilePath the private key file . @param passPhrase the password for the file . @return true if it is valid .
public static boolean checkPassPhrase(File keyFilePath, String passPhrase) {
        SshPrivateKeyFile keyFile = parsePrivateKeyFile(keyFilePath);
        if (keyFile != null) {
            try {
                keyFile.toPrivateKey(passPhrase);
            } catch (InvalidSshKeyException e) {
                return false;
            }
            return true;
        } else {
            return false;
        }
    }
public static boolean checkPassPhrase ( File keyFilePath , String passPhrase ) { SshPrivateKeyFile keyFile = parsePrivateKeyFile ( keyFilePath ) ; if ( keyFile != null ) { try { keyFile . toPrivateKey ( passPhrase ) ; } catch ( InvalidSshKeyException e ) { return false ; } return true ; } else { return false ; } }
Checks to see if the passPhrase is valid for the private key file.
Checks to see if the passPhrase is valid for the private key file .