4 int main (int argc
, const char *argv
[]) {
5 if (argc
< 3) return 1;
6 const unsigned char *txt
= (const unsigned char*)argv
[1];
7 const char *pkn
= argv
[2];
8 unsigned char *sig
= NULL
;
10 len
= strlen(argv
[1]);
13 ssl_key_t
*key
= ssl_key_init();
14 if (-1 == ssl_load_pub_fl(pkn
, key
))
16 if (0 == ssl_sign(txt
, len
, &sig
, &slen
, 0, key
)) {
17 int rc
= ssl_verify(txt
, len
, sig
, slen
, 0, key
);
18 printf("Signatute: ");
19 for (size_t i
= 0; i
< slen
; ++i
)
20 printf("%02X", sig
[i
]);
21 printf("\nResult: %d\n", rc
);