{"id":395,"date":"2013-09-16T21:16:42","date_gmt":"2013-09-17T05:16:42","guid":{"rendered":"http:\/\/unmitigatedrisk.com\/?p=395"},"modified":"2017-07-18T20:38:08","modified_gmt":"2017-07-19T04:38:08","slug":"how-to-generate-and-send-an-rfc3161-timestamp-with-openssl-and-curl","status":"publish","type":"post","link":"https:\/\/unmitigatedrisk.com\/?p=395","title":{"rendered":"How to generate and send an RFC3161 timestamp with OpenSSL and curl"},"content":{"rendered":"<p>For me the blog is this odd mix of diary and technical notes, this time I guess the post is more of a technical note &#8212; here is a quick guide on how to generate RFC 3161 time-stamps using OpenSSL and curl.<\/p>\n<p>&nbsp;<\/p>\n<p>1.\u00a0Create the file you will want to timestamp<\/p>\n<p>&nbsp;<\/p>\n<p style=\"padding-left: 30px;\">copy con inputfile.txt<\/p>\n<p style=\"padding-left: 30px;\">This is my test file.<\/p>\n<p style=\"padding-left: 30px;\">^Z<\/p>\n<p>&nbsp;<\/p>\n<p>2. Generate a timestamp request<\/p>\n<p>&nbsp;<\/p>\n<p style=\"padding-left: 30px;\">openssl ts -query -data inputfile.txt -cert -sha256 -no_nonce -out request.tsq<\/p>\n<p>&nbsp;<\/p>\n<p>3. Send the request to your timestamp server<\/p>\n<p>&nbsp;<\/p>\n<p class=\"p1\"><span class=\"s1\">curl -k -H &#8220;Content-Type: application\/timestamp-query&#8221; -H Host:timestamp.globalsign.com &#8211;data-binary @request.tsq &#8220;http:\/\/timestamp.globalsign.com&#8221;<span class=\"Apple-converted-space\">\u00a0 <\/span>&gt;inputfile.txt.tsr<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>4. Verify the timestamp response<\/p>\n<p>&nbsp;<\/p>\n<p style=\"padding-left: 30px;\">openssl ts -reply -in inputfile.txt.tsr -text<\/p>\n<p>&nbsp;<\/p>\n<p>This is going to give you some output that looks something like this:<\/p>\n<p>&nbsp;<\/p>\n<p style=\"padding-left: 30px;\">Using configuration from C:\\OpenSSL-Win64\\bin\\openssl.cfg<\/p>\n<p style=\"padding-left: 30px;\">Status info:<\/p>\n<p style=\"padding-left: 30px;\">Status: Granted.<\/p>\n<p style=\"padding-left: 30px;\">Status description: unspecified<\/p>\n<p style=\"padding-left: 30px;\">Failure info: unspecified<\/p>\n<p style=\"padding-left: 30px;\">TST info:<\/p>\n<p style=\"padding-left: 30px;\">Version: 1<\/p>\n<p style=\"padding-left: 30px;\">Policy OID: 1.3.6.1.4.1.4146.2.2<\/p>\n<p style=\"padding-left: 30px;\">Hash Algorithm: sha256<\/p>\n<p style=\"padding-left: 30px;\">Message data:<\/p>\n<p style=\"padding-left: 30px;\">\u00a0\u00a0\u00a0 0000 &#8211; 58 df 63 8c 5b bf ff ca-ad 13 c9 6e 93 96 cd 25\u00a0\u00a0 X.c.[&#8230;&#8230;n&#8230;%<\/p>\n<p style=\"padding-left: 30px;\">\u00a0\u00a0\u00a0 0010 &#8211; 66 5e f1 eb ba 8e 7f 74-6d 65 04 3c 5d ea e4 35\u00a0\u00a0 f^&#8230;..tme.&lt;]..5<\/p>\n<p style=\"padding-left: 30px;\">Serial number: 0x2487F5EA8A5A085844ED68A8A7426E07E692E1BD<\/p>\n<p style=\"padding-left: 30px;\">Time stamp: Sep 17 05:08:38 2013 GMT<\/p>\n<p style=\"padding-left: 30px;\">Accuracy: unspecified<\/p>\n<p style=\"padding-left: 30px;\">Ordering: no<\/p>\n<p style=\"padding-left: 30px;\">Nonce: unspecified<\/p>\n<p style=\"padding-left: 30px;\">TSA: DirName:\/C=SG\/O=GMO GlobalSign Pte Ltd\/CN=GlobalSign TSA for Standard &#8211; G1<\/p>\n<p style=\"padding-left: 30px;\">Extensions:<\/p>\n<p>It\u2019s that easy.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For me the blog is this odd mix of diary and technical notes, this time I guess the post is more of a technical note &#8212; here is a quick guide on how to generate RFC 3161 time-stamps using OpenSSL and curl. &nbsp; 1.\u00a0Create the file you will want to timestamp &nbsp; copy con inputfile.txt [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[4],"tags":[97,22,96,98],"class_list":["post-395","post","type-post","status-publish","format-standard","hentry","category-thoughts","tag-curl","tag-openssl","tag-rfc3161","tag-timestamping"],"_links":{"self":[{"href":"https:\/\/unmitigatedrisk.com\/index.php?rest_route=\/wp\/v2\/posts\/395","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unmitigatedrisk.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unmitigatedrisk.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unmitigatedrisk.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/unmitigatedrisk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=395"}],"version-history":[{"count":0,"href":"https:\/\/unmitigatedrisk.com\/index.php?rest_route=\/wp\/v2\/posts\/395\/revisions"}],"wp:attachment":[{"href":"https:\/\/unmitigatedrisk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=395"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unmitigatedrisk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=395"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unmitigatedrisk.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}