private String decodeHeadlessChallenge(String encodedPassword, File _privateKey)
      throws IOException, NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException,
             InvalidKeyException, IllegalBlockSizeException, BadPaddingException {

    final String RSA = "RSA";
    final String ASCII = "US-ASCII";

    // Read private key from file
    FileInputStream fstream = new FileInputStream(_privateKey);
    byte[] sshPrivateKey = IOUtils.toByteArray(fstream);
    PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(sshPrivateKey);
    KeyFactory kf = KeyFactory.getInstance(RSA);
    PrivateKey privateKey = kf.generatePrivate(keySpec);

    // Init RSA decrypter with private key
    Cipher decryptCipher = Cipher.getInstance(RSA);
    decryptCipher.init(2, privateKey);

    // Convert base 64 password string to raw bytes
    byte[] rawBytes = org.apache.commons.codec.binary.Base64.decodeBase64(encodedPassword.getBytes(ASCII));

    // Decrypt the encoded raw bytes using decrypter
    byte[] decodedBytes = decryptCipher.doFinal(rawBytes);

    // Return decoded bytes as string
    return new String(decodedBytes, ASCII);
  }
Decodes the encoded password using the _privateKey
@param encodedPassword
@param _privateKey
@return The decoded password
@throws IOException
@throws NoSuchAlgorithmException
@throws InvalidKeySpecException
@throws NoSuchPaddingException
@throws InvalidKeyException
@throws IllegalBlockSizeException
@throws BadPaddingException
app/com/linkedin/drelephant/clients/azkaban/AzkabanWorkflowClient.java