Web アプリのサーバー コード内でこのコードまたは同様のコードを何度も使用しましたが、現在、メンテナンス バックエンドで動作するコマンド ライン ユーティリティを作成しようとしています。
を取得し続けEncryptionOperationNotPossibleExceptionますが、コードで何が間違っているのかわかりません。スニペットをテストするために、実際の暗号化された文字列を使用して、それがテスト入力でないことを確認しました。
コードのどこからこの例外が発生するかを知っている人はいますか?
import org.jasypt.exceptions.EncryptionOperationNotPossibleException;
import org.jasypt.util.text.BasicTextEncryptor;
public class decipher {
/**
* @param args
*/
public static void main(String[] args) {
if (args[0] != null) {
String encstr = args[0];
String decstr = "";
if (encstr != null && !encstr.equals("")) {
try {
BasicTextEncryptor textEncryptor = new BasicTextEncryptor();
textEncryptor.setPassword("1234566789");
decstr = textEncryptor.decrypt(encstr);
System.out.println(decstr);
} catch (EncryptionOperationNotPossibleException e) {
System.out.println(e.toString());
}
} else {
System.out.println("Passed empty string... not decrypted.");
}
} else {
System.out.println("This program requires and encrypted text input.");
}
}
}