Top Description Fields Constructors Methods
org.apache.pdfbox.examples.signature

public Class ValidationTimeStamp

extends Object
Class Inheritance
Imports
java.io.ByteArrayInputStream, .IOException, .InputStream, java.net.MalformedURLException, .URI, .URISyntaxException, java.security.MessageDigest, .NoSuchAlgorithmException, java.util.ArrayList, .List, org.bouncycastle.asn1.ASN1Encodable, .ASN1EncodableVector, .ASN1ObjectIdentifier, .ASN1Primitive, .DERSet, org.bouncycastle.asn1.cms.Attribute, .AttributeTable, .Attributes, org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers, org.bouncycastle.cms.CMSSignedData, .SignerInformation, .SignerInformationStore, org.bouncycastle.tsp.TimeStampToken

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)
Authors
Others, Alexis Suter

Field Summary

Modifier and TypeField and Description
private TSAClient

Constructor Summary

AccessConstructor and Description
public
ValidationTimeStamp(String
The url where TS-Request will be done.
tsaUrl
)

Method Summary

Modifier and TypeMethod and Description
public CMSSignedData

Returns:

CMSSignedData Extended CMS signed data
addSignedTimeStamp
(CMSSignedData
Generated CMS signed data
signedData
)

Extend cms signed data with TimeStamp first or to all signers

public byte[]

Returns:

the byte[] of the timestamp token
getTimeStampToken
(InputStream
InputStream of the content to sign
content
)

Creates a signed timestamp token by the given input stream.

private SignerInformation

Returns:

information about SignerInformation
signTimeStamp
(SignerInformation
information about signer
signer
)

Extend CMS Signer Information with the TimeStampToken into the unsigned Attributes.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

tsaClientback to summary
private TSAClient tsaClient

Constructor Detail

ValidationTimeStampback to summary
public ValidationTimeStamp(String tsaUrl) throws NoSuchAlgorithmException, MalformedURLException, URISyntaxException
Parameters
tsaUrl:String

The url where TS-Request will be done.

Method Detail

addSignedTimeStampback to summary
public CMSSignedData addSignedTimeStamp(CMSSignedData signedData) throws IOException

Extend cms signed data with TimeStamp first or to all signers

Parameters
signedData:CMSSignedData

Generated CMS signed data

Returns:CMSSignedData

CMSSignedData Extended CMS signed data

getTimeStampTokenback to summary
public byte[] getTimeStampToken(InputStream content) throws IOException

Creates a signed timestamp token by the given input stream.

Parameters
content:InputStream

InputStream of the content to sign

Returns:byte[]

the byte[] of the timestamp token

signTimeStampback to summary
private SignerInformation signTimeStamp(SignerInformation signer) throws IOException

Extend CMS Signer Information with the TimeStampToken into the unsigned Attributes.

Parameters
signer:SignerInformation

information about signer

Returns:SignerInformation

information about SignerInformation