Skip to content
This repository has been archived by the owner on Feb 4, 2019. It is now read-only.

Commit

Permalink
0.3 - new call getSignerName(), fresh GT C API, better buildscript, u…
Browse files Browse the repository at this point in the history
…nit-tests, minor bugfix
  • Loading branch information
ristik committed Jul 22, 2011
1 parent 641c910 commit 9cddd29
Show file tree
Hide file tree
Showing 242 changed files with 47,475 additions and 90,699 deletions.
9 changes: 4 additions & 5 deletions README
@@ -1,18 +1,17 @@
API to access GuardTime services.


Includes C API in subdirectory libgt; and ugly hack to
make it produce only static base libs.
Includes GuardTime C API in subdirectory libgt-x.y

How to build:
npm link
or
node-waf configure build
node-waf configure build test install


Hello world:
---------
var gt = require('./guardtime');
var gt = require('guardtime');

gt.sign('Hello world!', function(err, ts) {
if(err) {
Expand All @@ -34,5 +33,5 @@ root value; and regularily publishes these root values in FT.


Published under Apache license v. 2.0.
Copyright GuardTime AS 2010
Copyright GuardTime AS 2010-2011

Binary file added cat.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cat.gif.gtts
Binary file not shown.
28 changes: 18 additions & 10 deletions guardtime.js
Expand Up @@ -21,12 +21,21 @@ function parseUri(sourceUri){


var GuardTime = module.exports = {
default_hashalg: 'sha256',
res: { // verification result bitmap constants
PUBLIC_KEY_SIGNATURE_PRESENT: 1,
PUBLICATION_REFERENCE_PRESENT: 2,
DOCUMENT_HASH_CHECKED: 16,
PUBLICATION_CHECKED: 32
default_hashalg: 'SHA256',
VER_ERR : {
NO_FAILURES : 0,
SYNTACTIC_CHECK_FAILURE : 1,
HASHCHAIN_VERIFICATION_FAILURE : 2,
PUBLIC_KEY_SIGNATURE_FAILURE : 16,
NOT_VALID_PUBLIC_KEY_FAILURE : 64,
WRONG_DOCUMENT_FAILURE : 128,
NOT_VALID_PUBLICATION : 256
},
VER_RES : {
PUBLIC_KEY_SIGNATURE_PRESENT : 1,
PUBLICATION_REFERENCE_PRESENT : 2,
DOCUMENT_HASH_CHECKED : 16,
PUBLICATION_CHECKED : 32
},
publications: {
data: '',
Expand Down Expand Up @@ -165,7 +174,7 @@ var GuardTime = module.exports = {
return callback(er);
}
if (callback)
callback(result, ts);
callback(null, ts);
});
});
},
Expand All @@ -185,7 +194,6 @@ var GuardTime = module.exports = {
if (typeof(callback) !== 'function')
callback = function (){};
var result = 0;

// if publications file is not yet downloaded - download and recall itself
if (!GuardTime.publications.data) {
return GuardTime.loadPublications(function(err){
Expand All @@ -201,9 +209,9 @@ var GuardTime = module.exports = {
if (!ts.isExtended() && !is_new) {
return GuardTime.extend(ts, function(err, xts) {
if (err) {
// no failover:
//no failover:
// return callback(err);
// failover:
//failover:
xts = ts;
}
try {
Expand Down

0 comments on commit 9cddd29

Please sign in to comment.