blob: 4c614322b5b03f3290a10889ab0a373faf315a45 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
/* ISC license. */
#include <skalibs/stralloc.h>
#include <s6-networking/sbearssl.h>
int sbearssl_rsa_pkey_from (sbearssl_rsa_pkey *l, br_rsa_public_key const *k, stralloc *sa)
{
if (!stralloc_readyplus(sa, k->nlen + k->elen)) return 0 ;
l->n = sa->len ;
stralloc_catb(sa, (char const *)k->n, k->nlen) ;
l->nlen = k->nlen ;
l->e = sa->len ;
stralloc_catb(sa, (char const *)k->e, k->elen) ;
l->elen = k->elen ;
return 1 ;
}
|