To encrypt a file: PBEFileProcessor -e [-a] fileName passPhrase.
If -a is specified the output file will be "ascii-armored".
To decrypt: PBEFileProcessor -d fileName passPhrase.
Note
this example will silently overwrite files, nor does it pay any attention to the specification of "_CONSOLE" in the filename. It also expects that a single pass phrase will have been used.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static void | |
| private static void | |
| private static void | |
| private static void | |
| public static void |
| PBEFileProcessor | back to summary |
|---|---|
| public PBEFileProcessor() | |
| decryptFile | back to summary |
|---|---|
| private static void decryptFile(String inputFileName, char[] passPhrase) throws IOException, PGPException | |
| decryptFile | back to summary |
|---|---|
| private static void decryptFile(InputStream in, char[] passPhrase) throws IOException, PGPException | |
| encryptFile | back to summary |
|---|---|
| private static void encryptFile(String outputFileName, String inputFileName, char[] passPhrase, boolean armor) throws IOException | |
| encryptToStream | back to summary |
|---|---|
| private static void encryptToStream(OutputStream out, String fileName, char[] passPhrase, boolean armor) throws IOException | |
| main | back to summary |
|---|---|
| public static void main(String[] args) throws Exception | |