Package net.jsign.timestamp
Class Timestamper
- java.lang.Object
-
- net.jsign.timestamp.Timestamper
-
- Direct Known Subclasses:
AuthenticodeTimestamper,RFC3161Timestamper
public abstract class Timestamper extends Object
Interface for a timestamping service.- Since:
- 1.3
- Author:
- Emmanuel Bourg
-
-
Constructor Summary
Constructors Constructor Description Timestamper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Timestampercreate(TimestampingMode mode)Returns the timestamper for the specified mode.voidsetRetries(int retries)Set the number of retries.voidsetRetryWait(int retryWait)Set the number of seconds to wait between retries.voidsetURL(String tsaurl)Set the URL of the timestamping service.voidsetURLs(String... tsaurls)Set the URLs of the timestamping services.CMSSignedDatatimestamp(DigestAlgorithm algo, CMSSignedData sigData)Timestamp the specified signature.
-
-
-
Constructor Detail
-
Timestamper
public Timestamper()
-
-
Method Detail
-
setURL
public void setURL(String tsaurl)
Set the URL of the timestamping service.- Parameters:
tsaurl- the URL of the timestamping service
-
setURLs
public void setURLs(String... tsaurls)
Set the URLs of the timestamping services.- Parameters:
tsaurls- the URLs of the timestamping services- Since:
- 2.0
-
setRetries
public void setRetries(int retries)
Set the number of retries.- Parameters:
retries- the number of retries
-
setRetryWait
public void setRetryWait(int retryWait)
Set the number of seconds to wait between retries.- Parameters:
retryWait- the wait time between retries (in seconds)
-
timestamp
public CMSSignedData timestamp(DigestAlgorithm algo, CMSSignedData sigData) throws TimestampingException, IOException, CMSException
Timestamp the specified signature.- Parameters:
algo- the digest algorithm used for the timestampsigData- the signed data to be timestamped- Returns:
- the signed data with the timestamp added
- Throws:
IOException- if an I/O error occursTimestampingException- if the timestamping keeps failing after the configured number of attemptsCMSException- if the signature cannot be generated
-
create
public static Timestamper create(TimestampingMode mode)
Returns the timestamper for the specified mode.- Parameters:
mode- the timestamping mode- Returns:
- a new timestamper for the specified mode
-
-