Giter Club home page Giter Club logo

openssl-tsa's Introduction

TO build a TSA with openssl

Config file

see openssl_config

Creating TSA keys and certs

Root certificate

openssl genrsa -out tsaroot.key 2048 -config openssl.cnf
openssl req -new -x509 -key tsaroot.key -out tsaroot.crt -config config/tsaroot.cnf

TSA Certificate

create a file extKey.ctl with the extended keyusages into it:

extendedKeyUsage = critical,timeStamping

openssl genrsa -out tsa.key 2048 -config openssl.cnf
openssl req -new -key tsa.key -out tsa.csr -config config/tsa.cnf
openssl x509 -req -days 730 -in tsa.csr -CA tsaroot.crt -CAkey tsaroot.key -set_serial 01 -out tsa.crt -extfile extKey.cnf

Using it

Creating a request

Usually needs to be setted:

  • no nonce
  • sha 256 hash algorithm
  • a policy id (expilicitally or using the config file alias)
  • the chertificate chain into the response

Something like this:

openssl ts -query -data input/input_file.txt -sha256 -no_nonce -cert -config openssl.cnf -policy 1.3.76.36.1.1.41 -out input/request.tsq

Sending the request to the tsa

openssl ts -reply -config openssl.cnf -queryfile input/request.tsq -inkey tsa.key -signer tsa.crt -out input/response.tsr

Verify the response

openssl ts -verify -queryfile input/request.tsq -in input/response.tsr -CAfile tsaroot.crt -untrusted tsa.crt

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.