public class MakeSignature
extends java.lang.Object
Modifier and Type | Class | Description |
---|---|---|
static class |
MakeSignature.CryptoStandard |
Constructor | Description |
---|---|
MakeSignature() |
Modifier and Type | Method | Description |
---|---|---|
static java.util.Collection<byte[]> |
processCrl(java.security.cert.Certificate cert,
java.util.Collection<CrlClient> crlList) |
Processes a CRL list.
|
static void |
signDeferred(PdfReader reader,
java.lang.String fieldName,
java.io.OutputStream outs,
ExternalSignatureContainer externalSignatureContainer) |
Signs a PDF where space was already reserved.
|
static void |
signDetached(PdfSignatureAppearance sap,
ExternalDigest externalDigest,
ExternalSignature externalSignature,
java.security.cert.Certificate[] chain,
java.util.Collection<CrlClient> crlList,
OcspClient ocspClient,
TSAClient tsaClient,
int estimatedSize,
MakeSignature.CryptoStandard sigtype) |
Signs the document using the detached mode, CMS or CAdES equivalent.
|
static void |
signDetached(PdfSignatureAppearance sap,
ExternalDigest externalDigest,
ExternalSignature externalSignature,
java.security.cert.Certificate[] chain,
java.util.Collection<CrlClient> crlList,
OcspClient ocspClient,
TSAClient tsaClient,
int estimatedSize,
MakeSignature.CryptoStandard sigtype,
SignaturePolicyInfo signaturePolicy) |
Signs the document using the detached mode, CMS or CAdES equivalent.
|
static void |
signDetached(PdfSignatureAppearance sap,
ExternalDigest externalDigest,
ExternalSignature externalSignature,
java.security.cert.Certificate[] chain,
java.util.Collection<CrlClient> crlList,
OcspClient ocspClient,
TSAClient tsaClient,
int estimatedSize,
MakeSignature.CryptoStandard sigtype,
org.bouncycastle.asn1.esf.SignaturePolicyIdentifier signaturePolicy) |
Signs the document using the detached mode, CMS or CAdES equivalent.
|
static void |
signExternalContainer(PdfSignatureAppearance sap,
ExternalSignatureContainer externalSignatureContainer,
int estimatedSize) |
Sign the document using an external container, usually a PKCS7.
|
public static void signDetached(PdfSignatureAppearance sap, ExternalDigest externalDigest, ExternalSignature externalSignature, java.security.cert.Certificate[] chain, java.util.Collection<CrlClient> crlList, OcspClient ocspClient, TSAClient tsaClient, int estimatedSize, MakeSignature.CryptoStandard sigtype) throws java.io.IOException, DocumentException, java.security.GeneralSecurityException
sap
- the PdfSignatureAppearanceexternalSignature
- the interface providing the actual signingchain
- the certificate chaincrlList
- the CRL listocspClient
- the OCSP clienttsaClient
- the Timestamp clientexternalDigest
- an implementation that provides the digestestimatedSize
- the reserved size for the signature. It will be estimated if 0sigtype
- Either Signature.CMS or Signature.CADESDocumentException
java.io.IOException
java.security.GeneralSecurityException
java.security.NoSuchAlgorithmException
java.lang.Exception
public static void signDetached(PdfSignatureAppearance sap, ExternalDigest externalDigest, ExternalSignature externalSignature, java.security.cert.Certificate[] chain, java.util.Collection<CrlClient> crlList, OcspClient ocspClient, TSAClient tsaClient, int estimatedSize, MakeSignature.CryptoStandard sigtype, SignaturePolicyInfo signaturePolicy) throws java.io.IOException, DocumentException, java.security.GeneralSecurityException
sap
- the PdfSignatureAppearanceexternalSignature
- the interface providing the actual signingchain
- the certificate chaincrlList
- the CRL listocspClient
- the OCSP clienttsaClient
- the Timestamp clientexternalDigest
- an implementation that provides the digestestimatedSize
- the reserved size for the signature. It will be estimated if 0sigtype
- Either Signature.CMS or Signature.CADESsignaturePolicy
- the signature policy (for EPES signatures)DocumentException
java.io.IOException
java.security.GeneralSecurityException
java.security.NoSuchAlgorithmException
java.lang.Exception
public static void signDetached(PdfSignatureAppearance sap, ExternalDigest externalDigest, ExternalSignature externalSignature, java.security.cert.Certificate[] chain, java.util.Collection<CrlClient> crlList, OcspClient ocspClient, TSAClient tsaClient, int estimatedSize, MakeSignature.CryptoStandard sigtype, org.bouncycastle.asn1.esf.SignaturePolicyIdentifier signaturePolicy) throws java.io.IOException, DocumentException, java.security.GeneralSecurityException
sap
- the PdfSignatureAppearanceexternalSignature
- the interface providing the actual signingchain
- the certificate chaincrlList
- the CRL listocspClient
- the OCSP clienttsaClient
- the Timestamp clientexternalDigest
- an implementation that provides the digestestimatedSize
- the reserved size for the signature. It will be estimated if 0sigtype
- Either Signature.CMS or Signature.CADESsignaturePolicy
- the signature policy (for EPES signatures)DocumentException
java.io.IOException
java.security.GeneralSecurityException
java.security.NoSuchAlgorithmException
java.lang.Exception
public static java.util.Collection<byte[]> processCrl(java.security.cert.Certificate cert, java.util.Collection<CrlClient> crlList)
cert
- a Certificate if one of the CrlList implementations needs to retrieve the CRL URL from it.crlList
- a list of CrlClient implementationspublic static void signExternalContainer(PdfSignatureAppearance sap, ExternalSignatureContainer externalSignatureContainer, int estimatedSize) throws java.security.GeneralSecurityException, java.io.IOException, DocumentException
sap
- the PdfSignatureAppearanceexternalSignatureContainer
- the interface providing the actual signingestimatedSize
- the reserved size for the signaturejava.security.GeneralSecurityException
java.io.IOException
DocumentException
public static void signDeferred(PdfReader reader, java.lang.String fieldName, java.io.OutputStream outs, ExternalSignatureContainer externalSignatureContainer) throws DocumentException, java.io.IOException, java.security.GeneralSecurityException
reader
- the original PDFfieldName
- the field to sign. It must be the last fieldouts
- the output PDFexternalSignatureContainer
- the signature container doing the actual signing. Only the
method ExternalSignatureContainer.sign is usedDocumentException
java.io.IOException
java.security.GeneralSecurityException
Copyright © 1998–2018. All rights reserved.