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

public Class TSAClient

extends Object
Class Inheritance
Imports
java.io.IOException, .InputStream, .OutputStream, java.math.BigInteger, java.net.URL, .URLConnection, java.nio.charset.StandardCharsets, java.security.DigestInputStream, .MessageDigest, .SecureRandom, java.util.Base64, .Random, org.apache.commons.logging.Log, .LogFactory, org.apache.pdfbox.io.IOUtils, org.apache.pdfbox.util.Hex, org.bouncycastle.asn1.ASN1ObjectIdentifier, org.bouncycastle.operator.DefaultDigestAlgorithmIdentifierFinder, .DigestAlgorithmIdentifierFinder, org.bouncycastle.tsp.TSPException, .TimeStampRequest, .TimeStampRequestGenerator, .TimeStampResponse, .TimeStampToken, .TimeStampTokenInfo

Time Stamping Authority (TSA) Client [RFC 3161].
Authors
Vakhtang Koroghlishvili, John Hewson

Field Summary

Modifier and TypeField and Description
private static final DigestAlgorithmIdentifierFinder
private final MessageDigest
private static final Log
private final String
private static final Random
private final URL
private final String

Constructor Summary

AccessConstructor and Description
public
TSAClient(URL
the URL of the TSA service
url
,
String
user name of TSA
username
,
String
password of TSA
password
,
MessageDigest
the message digest to use
digest
)

Method Summary

Modifier and TypeMethod and Description
public TimeStampToken

Returns:

the time stamp token
getTimeStampToken
(InputStream content)

private byte[]
getTSAResponse(byte[] request)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ALGORITHM_OID_FINDERback to summary
private static final DigestAlgorithmIdentifierFinder ALGORITHM_OID_FINDER
digestback to summary
private final MessageDigest digest
LOGback to summary
private static final Log LOG
passwordback to summary
private final String password
RANDOMback to summary
private static final Random RANDOM
urlback to summary
private final URL url
usernameback to summary
private final String username

Constructor Detail

TSAClientback to summary
public TSAClient(URL url, String username, String password, MessageDigest digest)
Parameters
url:URL

the URL of the TSA service

username:String

user name of TSA

password:String

password of TSA

digest:MessageDigest

the message digest to use

Method Detail

getTimeStampTokenback to summary
public TimeStampToken getTimeStampToken(InputStream content) throws IOException
Returns:TimeStampToken

the time stamp token

Exceptions
IOException:
if there was an error with the connection or data from the TSA server, or if the time stamp response could not be validated
getTSAResponseback to summary
private byte[] getTSAResponse(byte[] request) throws IOException