|
1 /* -*- Mode: C; tab-width: 8 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 |
|
7 #include "crmf.h" |
|
8 #include "crmfi.h" |
|
9 |
|
10 SECStatus |
|
11 CRMF_EncodeCertReqMsg(CRMFCertReqMsg *inCertReqMsg, |
|
12 CRMFEncoderOutputCallback fn, |
|
13 void *arg) |
|
14 { |
|
15 struct crmfEncoderOutput output; |
|
16 |
|
17 output.fn = fn; |
|
18 output.outputArg = arg; |
|
19 return SEC_ASN1Encode(inCertReqMsg,CRMFCertReqMsgTemplate, |
|
20 crmf_encoder_out, &output); |
|
21 |
|
22 } |
|
23 |
|
24 |
|
25 SECStatus |
|
26 CRMF_EncodeCertRequest(CRMFCertRequest *inCertReq, |
|
27 CRMFEncoderOutputCallback fn, |
|
28 void *arg) |
|
29 { |
|
30 struct crmfEncoderOutput output; |
|
31 |
|
32 output.fn = fn; |
|
33 output.outputArg = arg; |
|
34 return SEC_ASN1Encode(inCertReq, CRMFCertRequestTemplate, |
|
35 crmf_encoder_out, &output); |
|
36 } |
|
37 |
|
38 SECStatus |
|
39 CRMF_EncodeCertReqMessages(CRMFCertReqMsg **inCertReqMsgs, |
|
40 CRMFEncoderOutputCallback fn, |
|
41 void *arg) |
|
42 { |
|
43 struct crmfEncoderOutput output; |
|
44 CRMFCertReqMessages msgs; |
|
45 |
|
46 output.fn = fn; |
|
47 output.outputArg = arg; |
|
48 msgs.messages = inCertReqMsgs; |
|
49 return SEC_ASN1Encode(&msgs, CRMFCertReqMessagesTemplate, |
|
50 crmf_encoder_out, &output); |
|
51 } |
|
52 |
|
53 |
|
54 |
|
55 |