public class SigUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
checkCertificateUsage(X509Certificate x509Certificate)
Log if the certificate is not valid for signature usage.
|
static void |
checkResponderCertificateUsage(X509Certificate x509Certificate)
Log if the certificate is not valid for responding.
|
static void |
checkTimeStampCertificateUsage(X509Certificate x509Certificate)
Log if the certificate is not valid for timestamping.
|
static org.bouncycastle.tsp.TimeStampToken |
extractTimeStampTokenFromSignerInformation(org.bouncycastle.cms.SignerInformation signerInformation) |
static org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature |
getLastRelevantSignature(org.apache.pdfbox.pdmodel.PDDocument document)
Gets the last relevant signature in the document, i.e. the one with the
highest offset.
|
static int |
getMDPPermission(org.apache.pdfbox.pdmodel.PDDocument doc)
Get the access permissions granted for this document in the DocMDP transform
parameters dictionary.
|
static void |
setMDPPermission(org.apache.pdfbox.pdmodel.PDDocument doc,
org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature signature,
int accessPermissions)
Set the "modification detection and prevention" permissions granted for this
document in the DocMDP transform parameters dictionary.
|
static void |
validateTimestampToken(org.bouncycastle.tsp.TimeStampToken timeStampToken) |
static void |
verifyCertificateChain(org.bouncycastle.util.Store<org.bouncycastle.cert.X509CertificateHolder> certificatesStore,
X509Certificate certFromSignedData,
Date signDate)
Verify the certificate chain up to the root, including OCSP or CRL.
|
public static int getMDPPermission(org.apache.pdfbox.pdmodel.PDDocument doc)
doc - document.public static void setMDPPermission(org.apache.pdfbox.pdmodel.PDDocument doc,
org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature signature,
int accessPermissions)
throws IOException
doc - The document.signature - The signature object.accessPermissions - The permission value (1, 2 or 3).IOException - if a signature exists.public static void checkCertificateUsage(X509Certificate x509Certificate) throws CertificateParsingException
x509Certificate - CertificateParsingExceptionpublic static void checkTimeStampCertificateUsage(X509Certificate x509Certificate) throws CertificateParsingException
x509Certificate - CertificateParsingExceptionpublic static void checkResponderCertificateUsage(X509Certificate x509Certificate) throws CertificateParsingException
x509Certificate - CertificateParsingExceptionpublic static org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature getLastRelevantSignature(org.apache.pdfbox.pdmodel.PDDocument document)
throws IOException
document - to get its last signatureIOExceptionpublic static org.bouncycastle.tsp.TimeStampToken extractTimeStampTokenFromSignerInformation(org.bouncycastle.cms.SignerInformation signerInformation)
throws org.bouncycastle.cms.CMSException,
IOException,
org.bouncycastle.tsp.TSPException
org.bouncycastle.cms.CMSExceptionIOExceptionorg.bouncycastle.tsp.TSPExceptionpublic static void validateTimestampToken(org.bouncycastle.tsp.TimeStampToken timeStampToken)
throws org.bouncycastle.tsp.TSPException,
CertificateException,
org.bouncycastle.operator.OperatorCreationException,
IOException
org.bouncycastle.tsp.TSPExceptionCertificateExceptionorg.bouncycastle.operator.OperatorCreationExceptionIOExceptionpublic static void verifyCertificateChain(org.bouncycastle.util.Store<org.bouncycastle.cert.X509CertificateHolder> certificatesStore,
X509Certificate certFromSignedData,
Date signDate)
throws CertificateVerificationException,
CertificateException
certificatesStore - certFromSignedData - signDate - CertificateVerificationExceptionCertificateExceptionCopyright © 2016–2020 Imixs Software Solutions GmbH. All rights reserved.