: asapien/signet

1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
#ifndef SIGNET_TIMESTAMP_H
#define SIGNET_TIMESTAMP_H

#include <stddef.h>

#define TIMESTAMP_MAX_REPLY 65536

struct timestamp_reply {
	unsigned char data[TIMESTAMP_MAX_REPLY];
	size_t size;
	char at[32];
	const char *error;
};

/* HTTPS, SHA-256 imprint, fresh nonce, explicit TSA trust; no document upload. */
int timestamp_fetch(const char *url, const char *ca_file, const char *tls_ca_file,
    const char *sha256, long timeout_ms, struct timestamp_reply *reply);

#endif