Class ValidationTimeStamp
java.lang.Object
org.apache.pdfbox.examples.signature.ValidationTimeStamp
This 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)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.bouncycastle.cms.CMSSignedDataaddSignedTimeStamp(org.bouncycastle.cms.CMSSignedData signedData) Extend cms signed data with TimeStamp first or to all signersbyte[]getTimeStampToken(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 Details
-
tsaClient
-
-
Constructor Details
-
ValidationTimeStamp
public ValidationTimeStamp(String tsaUrl) throws NoSuchAlgorithmException, MalformedURLException, URISyntaxException - Parameters:
tsaUrl- The url where TS-Request will be done.- Throws:
NoSuchAlgorithmExceptionMalformedURLExceptionURISyntaxException
-
-
Method Details
-
getTimeStampToken
Creates 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:
IOException
-
addSignedTimeStamp
public org.bouncycastle.cms.CMSSignedData addSignedTimeStamp(org.bouncycastle.cms.CMSSignedData signedData) throws IOException Extend cms signed data with TimeStamp first or to all signers- Parameters:
signedData- Generated CMS signed data- Returns:
- CMSSignedData Extended CMS signed data
- Throws:
IOException
-
signTimeStamp
private org.bouncycastle.cms.SignerInformation signTimeStamp(org.bouncycastle.cms.SignerInformation signer) throws IOException Extend CMS Signer Information with the TimeStampToken into the unsigned Attributes.- Parameters:
signer- information about signer- Returns:
- information about SignerInformation
- Throws:
IOException
-