Tor  0.4.7.0-alpha-dev
Macros | Functions
signing.h File Reference

Header file for signing.c. More...

Go to the source code of this file.

Macros

#define DIROBJ_MAX_SIG_LEN   256
 

Functions

char * router_get_dirobj_signature (const char *digest, size_t digest_len, const crypto_pk_t *private_key)
 
int router_append_dirobj_signature (char *buf, size_t buf_len, const char *digest, size_t digest_len, crypto_pk_t *private_key)
 

Detailed Description

Header file for signing.c.

Definition in file signing.h.

Function Documentation

◆ router_append_dirobj_signature()

int router_append_dirobj_signature ( char *  buf,
size_t  buf_len,
const char *  digest,
size_t  digest_len,
crypto_pk_t private_key 
)

Helper: used to generate signatures for routers, directories and network-status objects. Given a digest in digest and a secret private_key, generate a PKCS1-padded signature, BASE64-encode it, surround it with --—BEGIN/END--— pairs, and write it to the buf_len-byte buffer at buf. Return 0 on success, -1 on failure.

Definition at line 79 of file signing.c.

◆ router_get_dirobj_signature()

char* router_get_dirobj_signature ( const char *  digest,
size_t  digest_len,
const crypto_pk_t private_key 
)

Helper: used to generate signatures for routers, directories and network-status objects. Given a digest_len-byte digest in digest and a secret private_key, generate an PKCS1-padded signature, BASE64-encode it, surround it with --—BEGIN/END--— pairs, and return the new signature on success or NULL on failure.

Definition at line 22 of file signing.c.

Referenced by router_append_dirobj_signature().