Top Description Fields Constructors Methods
org.apache.pdfbox.tools

public final Class Decrypt

extends Object
implements Callable<Integer>
Class Inheritance
All Implemented Interfaces
java.util.concurrent.Callable
Annotations
@Command
name:decrypt
header:Decrypts a PDF document
description:This will read an encrypted document and decrypt it either using a password or a certificate.
versionProvider:Version
mixinStandardHelpOptions:true
Imports
java.io.File, .FileInputStream, .IOException, .InputStream, .PrintStream, java.util.concurrent.Callable, org.apache.pdfbox.Loader, org.apache.pdfbox.pdmodel.PDDocument, org.apache.pdfbox.pdmodel.encryption.AccessPermission, picocli.CommandLine, .CommandLine.Command, .CommandLine.Option

This will read a document from the filesystem, decrypt it and and then write the result to the filesystem.
Author
Ben Litchfield

Field Summary

Modifier and TypeField and Description
private String
private File
private String
private File
private String
private final PrintStream

Constructor Summary

AccessConstructor and Description
public
Decrypt()

Constructor.

Method Summary

Modifier and TypeMethod and Description
public Integer
call()

Implements java.util.concurrent.Callable.call.

Computes a result, or throws an exception if unable to do so.

public static void
main(String[]
The command-line arguments.
args
)

This is the entry point for the application.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

aliasback to summary
private String alias
Annotations
@Option
names:-alias
description:the alias to the certificate in the keystore.
infileback to summary
private File infile
Annotations
@Option
names:-i, --input
description:the PDF file to decrypt
required:true
keyStoreback to summary
private String keyStore
Annotations
@Option
names:-keyStore
description:the path to the keystore that holds the certificate to decrypt the document. This is only required if the document is encrypted with a certificate, otherwise only the password is required.
outfileback to summary
private File outfile
Annotations
@Option
names:-o, --output
description:the decrypted PDF file. If omitted the original file is overwritten.
passwordback to summary
private String password
Annotations
@Option
names:-password
arity:0..1
interactive:true
description:the password for the PDF or certificate in keystore.
SYSERRback to summary
private final PrintStream SYSERR
Annotations
@SuppressWarnings:squid:S106

Constructor Detail

Decryptback to summary
public Decrypt()

Constructor.

Method Detail

callback to summary
public Integer call()

Implements java.util.concurrent.Callable.call.

Doc from java.util.concurrent.Callable.call.

Computes a result, or throws an exception if unable to do so.

Returns:Integer

computed result

mainback to summary
public static void main(String[] args)

This is the entry point for the application.

Parameters
args:String[]

The command-line arguments.