public class CadesSignatureStarter2 extends SignatureStarter2
callbackArgument, certificateBase64, client, ignoreRevocationStatusUnknown, securityContextId, signaturePolicyId| Constructor and Description |
|---|
CadesSignatureStarter2(RestPkiClient client)
Create a new instance using the given RestPkiClient.
|
| Modifier and Type | Method and Description |
|---|---|
void |
setCmsToCoSign(byte[] cmsToCoSign)
Sets the CMS to be co-signed as a byte array.
|
void |
setCmsToCoSign(FileResult fileResult)
Sets the file resulted from a previous signature to be co-signed.
|
void |
SetCmsToCoSign(FileResult fileResult)
Deprecated.
|
void |
setCmsToCoSign(java.io.InputStream stream)
Sets the CMS to be co-signed.
|
void |
setCmsToCoSign(java.nio.file.Path path)
Sets the path of the CMS file to be co-signed.
|
void |
setCmsToCoSign(java.lang.String path)
Sets the path of the CMS file to be co-signed.
|
void |
setContentToSign(byte[] content)
Sets the content to be signed as a byte array.
|
void |
setContentToSign(java.io.InputStream stream)
Sets the content to be signed.
|
void |
setEncapsulateContent(java.lang.Boolean encapsulateContent)
Optionally denotes whether the resulting CMS should include the content signed.
|
void |
setFileToSign(java.nio.file.Path path)
Sets the path of the file to be signed.
|
void |
setFileToSign(java.lang.String path)
Sets the path of the file to be signed.
|
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 CadesSignatureStarter2(RestPkiClient client)
client - the RestPkiClient which shall be used.public void setContentToSign(java.io.InputStream stream)
stream - a pre-opened InputStream linked to the file that will be signed. The stream is
NOT closed by this method.public void setContentToSign(byte[] content)
content - Binary content to be signed.public void setFileToSign(java.lang.String path)
path - Path of the file to be signed.public void setFileToSign(java.nio.file.Path path)
path - Path of the file to be signed.public void setCmsToCoSign(java.io.InputStream stream)
stream - a pre-opened InputStream linked to the CMS file that will be co-signed. The
stream is NOT closed by this method.public void setCmsToCoSign(byte[] cmsToCoSign)
cmsToCoSign - Binary content of the CMS to be co-signed.public void setCmsToCoSign(java.lang.String path)
path - Path of the CMS file to be co-signed.public void setCmsToCoSign(java.nio.file.Path path)
path - Path of the CMS file to be co-signed.@Deprecated public void SetCmsToCoSign(FileResult fileResult)
public void setCmsToCoSign(FileResult fileResult)
fileResult - FileResult from another signature process.public void setEncapsulateContent(java.lang.Boolean encapsulateContent)
If no CmsToSign is given, the resulting CMS will include the content
If a CmsToCoSign is given, the resulting CMS will include the content if and only if the CmsToCoSign also includes the content
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.