summaryrefslogtreecommitdiff
path: root/src/sbearssl/sbearssl_skey_storagelen.c
blob: 706b5f64a9a940bf138fb807e1dd0167164d457f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* ISC license. */

#include <s6-networking/sbearssl.h>

size_t sbearssl_skey_storagelen (sbearssl_skey const *l)
{
  switch (l->type)
  {
    case BR_KEYTYPE_RSA :
      return l->data.rsa.plen + l->data.rsa.qlen + l->data.rsa.dplen + l->data.rsa.dqlen + l->data.rsa.iqlen ;
    case BR_KEYTYPE_EC :
      return l->data.ec.xlen ;
    default :
      return 0 ;
  }
}