Class ValidationTimeStamp
- java.lang.Object
-
- org.apache.pdfbox.examples.signature.ValidationTimeStamp
-
public class ValidationTimeStamp extends java.lang.ObjectThis class wraps the TSAClient and the work that has to be done with it. Like Adding Signed TimeStamps to a signature, or creating a CMS timestamp attribute (with a signed timestamp)
-
-
Constructor Summary
Constructors Constructor Description ValidationTimeStamp(java.lang.String tsaUrl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.bouncycastle.cms.CMSSignedDataaddSignedTimeStamp(org.bouncycastle.cms.CMSSignedData signedData)Extend cms signed data with TimeStamp first or to all signersbyte[]getTimeStampToken(java.io.InputStream content)Creates a signed timestamp token by the given input stream.private org.bouncycastle.cms.SignerInformationsignTimeStamp(org.bouncycastle.cms.SignerInformation signer)Extend CMS Signer Information with the TimeStampToken into the unsigned Attributes.
-
-
-
Field Detail
-
tsaClient
private TSAClient tsaClient
-
-
Constructor Detail
-
ValidationTimeStamp
public ValidationTimeStamp(java.lang.String tsaUrl) throws java.security.NoSuchAlgorithmException, java.net.MalformedURLException, java.net.URISyntaxException- Parameters:
tsaUrl- The url where TS-Request will be done.- Throws:
java.security.NoSuchAlgorithmExceptionjava.net.MalformedURLExceptionjava.net.URISyntaxException
-
-
Method Detail
-
getTimeStampToken
public byte[] getTimeStampToken(java.io.InputStream content) throws java.io.IOExceptionCreates a signed timestamp token by the given input stream.- Parameters:
content- InputStream of the content to sign- Returns:
- the byte[] of the timestamp token
- Throws:
java.io.IOException
-
addSignedTimeStamp
public org.bouncycastle.cms.CMSSignedData addSignedTimeStamp(org.bouncycastle.cms.CMSSignedData signedData) throws java.io.IOExceptionExtend cms signed data with TimeStamp first or to all signers- Parameters:
signedData- Generated CMS signed data- Returns:
- CMSSignedData Extended CMS signed data
- Throws:
java.io.IOException
-
signTimeStamp
private org.bouncycastle.cms.SignerInformation signTimeStamp(org.bouncycastle.cms.SignerInformation signer) throws java.io.IOExceptionExtend CMS Signer Information with the TimeStampToken into the unsigned Attributes.- Parameters:
signer- information about signer- Returns:
- information about SignerInformation
- Throws:
java.io.IOException
-
-