Functions | |
| ops_boolean_t | ops_sign_file_as_cleartext (const char *input_filename, const char *output_filename, const ops_secret_key_t *skey, const ops_boolean_t overwrite) |
| Sign a file with a Cleartext Signature. | |
| ops_boolean_t | ops_sign_buf_as_cleartext (const char *cleartext, const size_t len, ops_memory_t **signed_cleartext, const ops_secret_key_t *skey) |
| Sign a buffer with a Cleartext signature. | |
| ops_boolean_t | ops_sign_file (const char *input_filename, const char *output_filename, const ops_secret_key_t *skey, const ops_boolean_t use_armour, const ops_boolean_t overwrite) |
| Sign a file. | |
| ops_memory_t * | ops_sign_buf (const void *input, const size_t input_len, const ops_sig_type_t sig_type, const ops_secret_key_t *skey, const ops_boolean_t use_armour, ops_boolean_t include_data) |
| Signs a buffer. | |
|
||||||||||||||||||||||||||||
|
Signs a buffer.
void example(const ops_secret_key_t *skey) { const char* buf="Some example text"; const size_t len=strlen(buf); const ops_boolean_t use_armour=ops_true; ops_memory_t* mem=NULL; mem=ops_sign_buf(buf,len,OPS_SIG_BINARY,skey,use_armour); if (mem) { printf ("OK"); ops_memory_free(mem); } else { printf("ERR"); } } |
|
||||||||||||||||||||
|
Sign a buffer with a Cleartext signature.
void example(const ops_secret_key_t *skey) { ops_memory_t* mem=NULL; const char* buf="Some example text"; size_t len=strlen(buf); if (ops_sign_buf_as_cleartext(buf,len, &mem, skey)==ops_true) printf("OK"); else printf("ERR"); // free signed cleartext after use ops_memory_free(mem); } |
|
||||||||||||||||||||||||
|
Sign a file.
void example(const ops_secret_key_t *skey) { const char* filename="mytestfile"; const ops_boolean_t use_armour=ops_false; const ops_boolean_t overwrite=ops_false; if (ops_sign_file(filename, NULL, skey, use_armour, overwrite)==ops_true) printf("OK"); else printf("ERR"); } |
|
||||||||||||||||||||
|
Sign a file with a Cleartext Signature.
void example(const ops_secret_key_t *skey, ops_boolean_t overwrite) { if (ops_sign_file_as_cleartext("mytestfile.txt",NULL,skey,overwrite)==ops_true) printf("OK"); else printf("ERR"); } |
1.4.6