Git Product home page Git Product logo

absolutetimestamp's Introduction

AbsoluteTimestamp

.NET library for creating and verifying RFC 3161 timestamps. Based on Bouncy Castle. Available on NuGet.

Basic usage

Creating a timestamp

TimestampCreator creator = new TimestampCreator();
TimestampObject timestamp = creator
    .SetTsaPrimaryUrl("http://example.com/tsa")
    .SetDataForTimestamping("Example.pdf")
    .CreateTimestamp();

Verifying a timestamp

TimestampVerifier verifier = new TimestampVerifier();
TimestampObject verifiedTimestamp = verifier
    .SetTimestampedData("Example.pdf")
    .SetTimestamp(timestamp.Timestamp)
    .Verify();

API

Items highlighted in bold are mandatory. For further info see ITimestampCreator and ITimestampVerifier interfaces.

Creating a timestamp

Inputs

  • Primary TSA url - (string)
  • Hash algorithm - (HashAlgorithm enum value)
  • Data to be timestamped
    • File - (byte[], stream, string)
    • List of files - (byte[][], stream[], string[])
    • Message digest(s) - (byte[], byte[][])
  • Output format - (OutputFormat enum value)
  • Secondary TSA url - (string)
  • Primary and secondary TSA credentials - (string)
  • TSA connection timeout - (int)
  • Minimum certificate validity period - (int)

Outputs

  • Timestamp
    • TSR format
    • ASIC-S format
  • Additional info (generated time, hash algorithm, signer info, ...)

Verifying a timestamp

Inputs

  • Timestamp - (string, byte[], stream)
  • Hash algorithm - (HashAlgorithm enum value)
  • Timestamped data
    • File - (byte[], stream, string)
    • List of files - (byte[][], stream[], string[])
    • Message digest(s) - (byte[], byte[][])
  • Minimum certificate validity period - (int)

Outputs

  • Timestamp
    • TSR format
    • ASIC-S format
  • Additional info (generated time, hash algorithm, signer info, ...)

Configuration file

Utils.LoadConfigurationFile("path/to/configuration/file.txt");

Several data, required for working with timestamps, can be provided through configuration file. Static data that doesn’t change, such as credentials to access TSA, can be retrieved from this file. This way the user doesn't have to specify these settings every time he wants to create or verify a timestamp. The configuration file is a simple text file. Each row contains exactly one key-value pair of settings separated with equals sign (example: hash.algorithm=sha1).

Configuration name Description Value
tsa.primary.url Url address of primary TSA
tsa.primary.username Username for accessing protected TSA
tsa.primary.password Password for accessing protected TSA
tsa.secondary.url Url address of secondary TSA
tsa.secondary.username Username for accessing protected TSA
tsa.secondary.password Password for accessing protected TSA
tsa.timeout TSA connection timeout limit (milliseconds)
hash.algorithm Hash algorithm used to create message digest MD5/SHA1/SHA256/SHA512
timestamp.output Specifies format of timestamp that is returned TSR/ASICS
certificate.minimum.validity Minimum time period when signing certificate has to be valid (days)

absolutetimestamp's People

Contributors

honsdomi avatar

Stargazers

 avatar

Watchers

 avatar  avatar

absolutetimestamp's Issues

TimeStamp Verify problem

Hi I have problem with verifing timesamp. I created timestamp succesfuly and save the timestamp.Timestamp byte array. My problem is verifying timestamp. Im sending verify functiond to diffrenet data with old Timestamp byte array and it verifying. What I'm tring to do is prove the data isnt changed . Here is my code ;

TimestampVerifier verifier = new TimestampVerifier();
TimestampObject verifiedTimestamp = verifier
.SetTimestampedData("hello world 2")
.SetHashAlgorithm(HashAlgorithm.SHA512)
.SetTimestamp(FirstTsa.Timestamp) ------>this time stamp created with data as "test data "
.Verify();

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.