1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/nss/lib/crmf/crmfenc.c Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,55 @@ 1.4 +/* -*- Mode: C; tab-width: 8 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 + 1.10 +#include "crmf.h" 1.11 +#include "crmfi.h" 1.12 + 1.13 +SECStatus 1.14 +CRMF_EncodeCertReqMsg(CRMFCertReqMsg *inCertReqMsg, 1.15 + CRMFEncoderOutputCallback fn, 1.16 + void *arg) 1.17 +{ 1.18 + struct crmfEncoderOutput output; 1.19 + 1.20 + output.fn = fn; 1.21 + output.outputArg = arg; 1.22 + return SEC_ASN1Encode(inCertReqMsg,CRMFCertReqMsgTemplate, 1.23 + crmf_encoder_out, &output); 1.24 + 1.25 +} 1.26 + 1.27 + 1.28 +SECStatus 1.29 +CRMF_EncodeCertRequest(CRMFCertRequest *inCertReq, 1.30 + CRMFEncoderOutputCallback fn, 1.31 + void *arg) 1.32 +{ 1.33 + struct crmfEncoderOutput output; 1.34 + 1.35 + output.fn = fn; 1.36 + output.outputArg = arg; 1.37 + return SEC_ASN1Encode(inCertReq, CRMFCertRequestTemplate, 1.38 + crmf_encoder_out, &output); 1.39 +} 1.40 + 1.41 +SECStatus 1.42 +CRMF_EncodeCertReqMessages(CRMFCertReqMsg **inCertReqMsgs, 1.43 + CRMFEncoderOutputCallback fn, 1.44 + void *arg) 1.45 +{ 1.46 + struct crmfEncoderOutput output; 1.47 + CRMFCertReqMessages msgs; 1.48 + 1.49 + output.fn = fn; 1.50 + output.outputArg = arg; 1.51 + msgs.messages = inCertReqMsgs; 1.52 + return SEC_ASN1Encode(&msgs, CRMFCertReqMessagesTemplate, 1.53 + crmf_encoder_out, &output); 1.54 +} 1.55 + 1.56 + 1.57 + 1.58 +