Package eu.europa.esig.dss.service.tsp
Class OnlineTSPSource
java.lang.Object
eu.europa.esig.dss.service.tsp.OnlineTSPSource
- All Implemented Interfaces:
TSPSource
,Serializable
Class encompassing a RFC 3161 TSA, accessed through HTTP(S) to a given URI
- See Also:
-
Constructor Summary
ConstructorDescriptionThe default constructor for OnlineTSPSource.OnlineTSPSource
(String tspServer) Builds an OnlineTSPSource that will query the specified URL with defaultTimestampDataLoader
OnlineTSPSource
(String tspServer, DataLoader dataLoader) Builds an OnlineTSPSource that will query the URL and the specifiedDataLoader
-
Method Summary
Modifier and TypeMethodDescriptiongetTimeStampResponse
(DigestAlgorithm digestAlgorithm, byte[] digest) Gets a TimeStampResponse relevant to the provided digestvoid
setDataLoader
(DataLoader dataLoader) Set the DataLoader to use for querying the TSP server.void
setNonceSource
(NonceSource nonceSource) Set the NonceSource to use for querying the TSP server.void
setPolicyOid
(String policyOid) Set the request policyvoid
setTspServer
(String tspServer) Set the URL of the TSA
-
Constructor Details
-
OnlineTSPSource
public OnlineTSPSource()The default constructor for OnlineTSPSource. -
OnlineTSPSource
Builds an OnlineTSPSource that will query the specified URL with defaultTimestampDataLoader
- Parameters:
tspServer
- the tsp URL
-
OnlineTSPSource
Builds an OnlineTSPSource that will query the URL and the specifiedDataLoader
- Parameters:
tspServer
- the tsp URLdataLoader
-DataLoader
to retrieve the TSP
-
-
Method Details
-
setTspServer
Set the URL of the TSA- Parameters:
tspServer
- the TSA url
-
setPolicyOid
Set the request policy- Parameters:
policyOid
- the policy oid to use
-
setDataLoader
Set the DataLoader to use for querying the TSP server.- Parameters:
dataLoader
- the component that allows to retrieve the TSP response using HTTP.
-
setNonceSource
Set the NonceSource to use for querying the TSP server.- Parameters:
nonceSource
- the component that prevents the replay attack.
-
getTimeStampResponse
public TimestampBinary getTimeStampResponse(DigestAlgorithm digestAlgorithm, byte[] digest) throws DSSException Description copied from interface:TSPSource
Gets a TimeStampResponse relevant to the provided digest- Specified by:
getTimeStampResponse
in interfaceTSPSource
- Parameters:
digestAlgorithm
- the used digest algorithmdigest
- the computed digest to be timestamped- Returns:
TimestampBinary
binary of a signed timestamp token- Throws:
DSSException
- if any error occurred
-