1
  %  ÁˆÆ“þYx8Ûd•Ù ¥hMìÕÿ?Øöõ×475ãÅÓ Û   Á‹      •SÁŽ›0½ó¯—u! ém£´=TÝc¤j{B(2*À^cÒ�¢ü{mìeí©œ†yoÞ¼ñØ'®Pð�žHcE/c£hÁ¢xï³l¹	‚xµÂÒTjTŠ'®^´„üØŠ‚·Ïu3äXÅA)úÁqžfÀèê³$Qáx“Û‚‰â�Qdxx¸E>¨Ûö>í&²­óÑì<Xá¹&)ÅÐhTÈ÷‘TB’Òç|m;t¤kq@©ˆkÀQ�}©Ñ˜kszTý`ÅtmgmG‚És›õ�\×“²óŸG†iÉßÍuSNaG]AjWaï�¦/	_¢$J¦ÿÒ4>
uÆoÝ´SFrÅ;\ÜlW8i7ŒµÀËHêMtï—ŸÞú¿|Êzîé/xYÒ05Oç*é•w²%ïÙ,\)~6KJ“ŸC¬³Ð"öó­·¸€qöè˜!Xq—o1®/º�:.)ãé:c–’&ËB¼obW-œöri‹ÇØ~Eº‘d÷"FÅJ¬m}jš™8aÙÿˆÅÁ¼Þ�¸ðŸÏiaì�óí›®æ7Œý�ª¦§ßÞ�×§b­Ø¹A'cK½J¡´}ï66Á?Ë;Ñ€    5  Ãˆ¾�þB gÎâ‰’6çóØƒh¹×a–Ðz¾”d
i?u8 ™¸Ðn21hßÔ     Ã1
  8  Åˆl–Ým_Jõ!¶e8 EpM\ ”Å£�þeŽ0,ão>FÀß#ÀþÚ„q¦™ÙÜ¿Õ ?÷    Å/* -*- Mode: C; tab-width: 8 -*-*/
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef _CRMF_H_
#define _CRMF_H_

#include "seccomon.h"
#include "cert.h"
#include "crmft.h"
#include "secoid.h"
#include "secpkcs7.h"

SEC_BEGIN_PROTOS

/*
 * FUNCTION: CRMF_EncodeCertReqMsg
 * INPUTS:
 *    inCertReqMsg
 *        The Certificate Request Message to be encoded.
 *    fn
 *        A Callback function that the ASN1 encoder calls whenever
 *        the encoder wants to write out some DER encoded bytes.
 *    arg
 *        An opaque pointer that gets passed to the function fn
 * OUTPUT:
 *    The function fn will be called multiple times.  Look at the
 *    comments in crmft.h where the CRMFEncoderOutputCallback type is
 *    defined for information on proper behavior of the function fn.
 * RETURN:
 *    SECSuccess if encoding was successful.  Any other return value
 *    indicates an error occurred during encoding.
 */
extern SECStatus
CRMF_EncodeCertReqMsg(CRMFCertReqMsg *inCertReqMsg,
                      CRMFEncoderOutputCallback fn,
                      void *arg);

/*
 * FUNCTION: CRMF_EncoderCertRequest
 * INPUTS:
 *    inCertReq
 *        The Certificate Request to be encoded.
 *    fn
 *        A Callback function that the ASN1 encoder calls whenever
 *        the encoder wants to write out some DER encoded bytes.
 *    arg
 *        An opaque pointer that gets passed to the function fn.
 * OUTPUT:
 *    The function fn will be called, probably multiple times whenever
 *    the ASN1 encoder wants to write out DER-encoded bytes.  Look at the
 *    comments in crmft.h where the CRMFEncoderOutputCallback type is
 *    defined for information on proper behavior of the function fn.
 * RETURN:
 *    SECSuccess if encoding was successful.  Any other return value
 *    indicates an error occurred during encoding.
 */
extern SECStatus CRMF_EncodeCertRequest(CRMFCertRequest *inCertReq,
                                        CRMFEncoderOutputCallback fn,
                                        void *arg);
/*
 * FUNCTION: CRMF_EncodeCertReqMessages
 * INPUTS:
 *    inCertReqMsgs
 *        An array of pointers to the Certificate Request Messages
 *        to encode.  The user must place a NULL pointer in the index
 *        after the last message to be encoded.  When the library runs
 *        into the NULL pointer, the library assumes there are no more
 *        messages to encode.
 *    fn
 *        A Callback function that the ASN1 encoder calls whenever
 *        the encoder wants to write out some DER encoded byts.
 *    arg
 *        An opaque pointer that gets passed to the function fn.
 *
 * NOTES:
 *    The parameter inCertReqMsgs needs to be an array with a NULL pointer
 *    to signal the end of messages.  An array in the form of
 *    {m1, m2, m3, NULL, m4, ...} will only encode the messages m1, m2, and
 *    m3.  All messages from m4 on will not be looked at by the library.
 *
 * OUTPUT:
 *    The function fn will be called, probably multiple times.  Look at the
 *    comments in crmft.h where the CRMFEncoderOutputCallback type is
 *    defined for information on proper behavior of the function fn.
 *
 * RETURN:
 * SECSuccess if encoding the Certificate Request Messages was successful.
 * Any 