Skip to content

Timestamping

Luís Gonçalves edited this page Feb 19, 2022 · 3 revisions

Whenever a time-stamp property is used, XAdES4j uses a TimeStampTokenProvider to actually obtain the time-stamp token. The input calculation is handled by the library and the provider is invoked with the resulting octet-stream.

public interface TimeStampTokenProvider
{
   public TimeStampTokenRes getTimeStampToken(byte[] tsDigestInput, String digestAlgUri);
}

As with other providers, a TimeStampTokenProvider is configured in the signing profile.

XadesSigningProfile p = new XadesBesSigningProfile(...)
  .withTimeStampTokenProvider(MyTimeStampTokenProvider.class);

The library includes a default implementation which obtains tokens from a TSA using HTTP and supports Basic authentication. The TSA to use must be configured by registering a HttpTsaConfiguration instance on teh signing profile.

XadesSigningProfile p = new XadesBesSigningProfile(...)
  .with(new HttpTsaConfiguration("url", "user", "password"));