Skip to content

Simple Java project that uses Bouncy Castle API to send TimeStamp request (to free TSA).

Notifications You must be signed in to change notification settings

vakho10/Java-TSA-TimeStamper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Java TSA TimeStamper

Simple Java project that uses Bouncy Castle API to send TimeStamp request (to free TSA).

Usage

import org.bouncycastle.tsp.TSPAlgorithms;
import org.bouncycastle.tsp.TimeStampResponse;

public class Main
{
    public static void main(String[] args) throws Exception
    {
        // Construct TimeStamper object using builder class...
        TimeStamper timeStamper = new TimeStamper.Builder()
                .requestMethod("GET")
                .messageDigest("SHA-256", TSPAlgorithms.SHA256)
                .tsaUrl("http://some-tsa-url.com")
                .data("Some!".getBytes())
                .build();

        // Call timestamp method to get TimeStampResponse.
        TimeStampResponse response = timeStamper.timestamp();

        // Print or use it anywhere...
        System.out.println(response.getTimeStampToken().getTimeStampInfo().getGenTime());
    }
}

About

Simple Java project that uses Bouncy Castle API to send TimeStamp request (to free TSA).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages