2 * CertBuilderApp.cpp - support for constructing certs, CDSA version
5 #ifndef _CERT_BUILDER_APP_H_
6 #define _CERT_BUILDER_APP_H_
8 #include <Security/cssm.h>
9 #include <Security/x509defs.h>
17 * Name/OID pair used in CB_BuildX509Name
25 * Build up a CSSM_X509_NAME from an arbitrary list of name/OID pairs.
26 * We do one a/v pair per RDN.
28 CSSM_X509_NAME
*CB_BuildX509Name(
29 const CB_NameOid
*nameArray
,
32 /* free the CSSM_X509_NAME obtained from CB_BuildX509Name */
36 /* Obtain a CSSM_X509_TIME representing "now" plus specified seconds, or
37 * from a preformatted gen time string */
38 CSSM_X509_TIME
*CB_BuildX509Time(
39 unsigned secondsFromNow
, /* ignored if timeStr non-NULL */
40 const char *timeStr
=NULL
); /* optional, from genTimeAtNowPlus */
42 /* Free CSSM_X509_TIME obtained in CB_BuildX509Time */
44 CSSM_X509_TIME
*xtime
);
46 CSSM_DATA_PTR
CB_MakeCertTemplate(
48 CSSM_CL_HANDLE clHand
,
50 const CSSM_X509_NAME
*issuerName
,
51 const CSSM_X509_NAME
*subjectName
,
52 const CSSM_X509_TIME
*notBefore
,
53 const CSSM_X509_TIME
*notAfter
,
54 const CSSM_KEY_PTR subjectPubKey
,
55 CSSM_ALGORITHMS sigAlg
, // e.g., CSSM_ALGID_SHA1WithRSA
57 const CSSM_DATA
*subjectUniqueId
,
58 const CSSM_DATA
*issuerUniqueId
,
59 CSSM_X509_EXTENSION
*extensions
,
60 unsigned numExtensions
);
65 #endif /* _CERT_BUILDER_APP_H_ */