public class PadesSignatureStarter2 extends SignatureStarter2
callbackArgument, certificateBase64, client, ignoreRevocationStatusUnknown, securityContextId, signaturePolicyId| Constructor and Description |
|---|
PadesSignatureStarter2(RestPkiClient client)
Create a new instance using the given RestPkiClient.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPdfMark(PdfMark pdfMark)
Adds a new PDF mark to the list.
|
void |
setBypassMarksIfSigned(boolean bypassMarksIfSigned)
Denotes whether to bypass the PDF marks if the PDF is already signed (default true).
|
void |
setMeasurementUnits(PadesMeasurementUnits measurementUnits)
Optional, sets the unit of measurement used to edit the pdf marks and visual
representations.
|
void |
setPageOptimization(PadesPageOptimization pageOptimization)
Optional, sets the page size used to calculate the conversion between centimeter
measurements and PDF points.
|
void |
setPdfMarks(java.util.List<PdfMark> pdfMarks)
Optional, sets the setting to mark the pdf with the signature.
|
void |
setPdfToSign(byte[] content)
Sets the PDF to be signed via a byte array.
|
void |
setPdfToSign(FileResult fileResult)
Sets the PDF to be signed from a previous signature's result to be co-signed.
|
void |
setPdfToSign(java.io.InputStream stream)
Sets the PDF to be signed via a stream object.
|
void |
setPdfToSign(java.nio.file.Path path)
Sets the file path of the PDF to be signed.
|
void |
setPdfToSign(java.lang.String path)
Sets the file path of the PDF to be signed.
|
void |
setVisualRepresentation(PadesVisualRepresentation visualRepresentation)
Optional, sets the settings for the signature's visual representation.
|
SignatureStartResult |
start()
Performs the first step, should be called after setting the necessary parameters.
|
SignatureStartWithWebPkiResult |
startWithWebPki()
Performs the first step, should be called after setting the necessary parameters.
|
setCallbackArgument, setIgnoreRevocationStatusUnknown, setSecurityContext, setSignaturePolicy, setSignerCertificate, setSignerCertificateBase64, setSignerCertificateRawpublic PadesSignatureStarter2(RestPkiClient client)
client - the RestPkiClient which shall be used.public void setPdfToSign(java.io.InputStream stream)
stream - A pre-opened InputStream linked to the PDF that will be signed. The stream is
NOT closed by this method.public void setPdfToSign(byte[] content)
content - Binary content of the PDF.public void setPdfToSign(java.lang.String path)
path - File path of the PDF to be signed.public void setPdfToSign(java.nio.file.Path path)
path - File path of the PDF to be signed.public void setPdfToSign(FileResult fileResult)
fileResult - FileResult from previous signature with Rest PKI.public void setBypassMarksIfSigned(boolean bypassMarksIfSigned)
bypassMarksIfSigned - Chosen behaviorpublic void setPageOptimization(PadesPageOptimization pageOptimization)
pageOptimization - Page size and orientation.public void setMeasurementUnits(PadesMeasurementUnits measurementUnits)
measurementUnits - Unit of Measurement.public void setVisualRepresentation(PadesVisualRepresentation visualRepresentation)
visualRepresentation - The visual representation's settings.public void setPdfMarks(java.util.List<PdfMark> pdfMarks)
pdfMarks - List with PDF marks.public void addPdfMark(PdfMark pdfMark)
pdfMark - PDF mark.public SignatureStartResult start() throws RestException, java.io.IOException
start in class SignatureStarter2RestException - if an error occurs when calling REST PKI.java.io.IOException - if an error occurs when trying to obtain the file to be signed or be
cosign or when trying to compute all hashes from this file, both files
had to be provided before this method is called.public SignatureStartWithWebPkiResult startWithWebPki() throws RestException, java.io.IOException
startWithWebPki in class SignatureStarter2RestException - if an error occurs when calling REST PKI.java.io.IOException - if an error occurs when trying to obtain the file to be signed or be
cosign or when trying to compute all hashes from this file, both files
had to be provided before this method is called.