cert.h
1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef __BB_SK_CERT_HDR__
#define __BB_SK_CERT_HDR__
/* utility functions for managing and verifying certs */
#include <PR/bbcert.h>
#include "skerror.h"
#include "util.h"
#define CHAIN_TYPE_DONT_CARE 0
#define CHAIN_TYPE_TICKET_PUB 1
#define CHAIN_TYPE_CONTENT_PUB 2
/*
* XXX: these two verification functions are stubbed out now.
* once in place these function declarations should be
* moved to an appropriate header.
*/
/* terminate data arg with zero size element. */
int verifyRsaSig(
SkDataChain *data,
u8 *rsaPubkey, /* size determined by sigType arg */
BbRsaExponent rsaExp,
u32 sigType, /* signature type, BB_SIG_TYPE_* */
BbGenericSig *signature /* compare against this */
);
int TESTverifyEccSig(
SkDataChain *data,
u8 *eccPubkey, /* size determined by sigType arg */
u32 sigType, /* signature type, BB_SIG_TYPE_* */
BbGenericSig *signature /* compare against this */
);
/*
* Cert handling functions
*/
/* return size (>0) on success, error code (<0) on failure. */
int getCertSize(BbCertBase *cert);
/* return size (>0) on success, error code (<0) on failure. */
int getCertSigSize(BbCertBase *cert);
int getCertSig(BbCertBase *cert,BbGenericSig **sig);
int verifyCertSig(BbCertBase *cert, BbCertBase *signer);
/* serverType arg is CHAIN_TYPE_*, defined earlier in this file. */
int verifyCertChain(BbCertBase **chain, u32 chainType);
#endif