tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

crmfenc.c (1426B)


      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 #include "crmf.h"
      7 #include "crmfi.h"
      8 
      9 SECStatus
     10 CRMF_EncodeCertReqMsg(CRMFCertReqMsg *inCertReqMsg,
     11                      CRMFEncoderOutputCallback fn,
     12                      void *arg)
     13 {
     14    struct crmfEncoderOutput output;
     15 
     16    output.fn = fn;
     17    output.outputArg = arg;
     18    return SEC_ASN1Encode(inCertReqMsg, CRMFCertReqMsgTemplate,
     19                          crmf_encoder_out, &output);
     20 }
     21 
     22 SECStatus
     23 CRMF_EncodeCertRequest(CRMFCertRequest *inCertReq,
     24                       CRMFEncoderOutputCallback fn,
     25                       void *arg)
     26 {
     27    struct crmfEncoderOutput output;
     28 
     29    output.fn = fn;
     30    output.outputArg = arg;
     31    return SEC_ASN1Encode(inCertReq, CRMFCertRequestTemplate,
     32                          crmf_encoder_out, &output);
     33 }
     34 
     35 SECStatus
     36 CRMF_EncodeCertReqMessages(CRMFCertReqMsg **inCertReqMsgs,
     37                           CRMFEncoderOutputCallback fn,
     38                           void *arg)
     39 {
     40    struct crmfEncoderOutput output;
     41    CRMFCertReqMessages msgs;
     42 
     43    output.fn = fn;
     44    output.outputArg = arg;
     45    msgs.messages = inCertReqMsgs;
     46    return SEC_ASN1Encode(&msgs, CRMFCertReqMessagesTemplate,
     47                          crmf_encoder_out, &output);
     48 }