To sign a file: SignedFileProcessor -s [-a] fileName secretKey passPhrase.
If -a is specified the output file will be "ascii-armored".
To decrypt: SignedFileProcessor -v fileName publicKeyFile.
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.
Note
the example also makes use of PGP compression. If you are having difficulty getting it to interoperate with other PGP programs try removing the use of compression first.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static void | |
| private static void | signFile(String fileName, InputStream keyIn, OutputStream out, char[] pass, boolean armor)
Generate an encapsulated signed file. |
| private static void |
| SignedFileProcessor | back to summary |
|---|---|
| public SignedFileProcessor() | |
| main | back to summary |
|---|---|
| public static void main(String[] args) throws Exception | |
| signFile | back to summary |
|---|---|
| private static void signFile(String fileName, InputStream keyIn, OutputStream out, char[] pass, boolean armor) throws IOException, PGPException Generate an encapsulated signed file. | |
| verifyFile | back to summary |
|---|---|
| private static void verifyFile(InputStream in, InputStream keyIn) throws Exception | |