/*******************************************************************
 *
 * This file was generated by TIS/ASN1COMP Ver. 4.0, an ASN.1 compiler.
 * TIS/ASN1COMP is Copyright (c) 1998, TIS Labs at Network Associates, Inc.
 *
 * This file was AUTOMATICALLY GENERATED on Wed Nov 18 16:32:31 1998
 *
 ******************************************************************/

/*******************************************************************
 *
 *  .h file to declare ASN.1 functions
 *
 ******************************************************************/

#ifndef pkcs7_ASN_H_
#define pkcs7_ASN_H_

#include <stdio.h>

#include "pkcs7.h"

/*******************************************************************
 *
 * Function declarations
 *
 ******************************************************************/

#define PKINewContentType  (PKIContentType *)PKINewOBJECT_ID
#define PKIFreeContentType PKIFreeOBJECT_ID
#define PKISizeofContentType PKISizeofOBJECT_ID
#define PKIPackContentType PKIPackOBJECT_ID
#define PKIUnpackContentType PKIUnpackOBJECT_ID

#define PKINewData  (PKIData *)PKINewOCTET_STRING
#define PKIFreeData PKIFreeOCTET_STRING
#define PKISizeofData PKISizeofOCTET_STRING
#define PKIPackData PKIPackOCTET_STRING
#define PKIUnpackData PKIUnpackOCTET_STRING

#define PKINewDigest  (PKIDigest *)PKINewOCTET_STRING
#define PKIFreeDigest PKIFreeOCTET_STRING
#define PKISizeofDigest PKISizeofOCTET_STRING
#define PKIPackDigest PKIPackOCTET_STRING
#define PKIUnpackDigest PKIUnpackOCTET_STRING

#define PKINewEncryptedContent  (PKIEncryptedContent *)PKINewOCTET_STRING
#define PKIFreeEncryptedContent PKIFreeOCTET_STRING
#define PKISizeofEncryptedContent PKISizeofOCTET_STRING
#define PKIPackEncryptedContent PKIPackOCTET_STRING
#define PKIUnpackEncryptedContent PKIUnpackOCTET_STRING

#define PKINewEncryptedDigest  (PKIEncryptedDigest *)PKINewOCTET_STRING
#define PKIFreeEncryptedDigest PKIFreeOCTET_STRING
#define PKISizeofEncryptedDigest PKISizeofOCTET_STRING
#define PKIPackEncryptedDigest PKIPackOCTET_STRING
#define PKIUnpackEncryptedDigest PKIUnpackOCTET_STRING

#define PKINewEncryptedKey  (PKIEncryptedKey *)PKINewOCTET_STRING
#define PKIFreeEncryptedKey PKIFreeOCTET_STRING
#define PKISizeofEncryptedKey PKISizeofOCTET_STRING
#define PKIPackEncryptedKey PKIPackOCTET_STRING
#define PKIUnpackEncryptedKey PKIUnpackOCTET_STRING

#define PKINewSignature  (PKISignature *)PKINewBIT_STRING
#define PKIFreeSignature PKIFreeBIT_STRING
#define PKISizeofSignature PKISizeofBIT_STRING
#define PKIPackSignature PKIPackBIT_STRING
#define PKIUnpackSignature PKIUnpackBIT_STRING

PKICertificateRevocationLists *PKINewCertificateRevocationLists(
    PKICONTEXT *ctx);
void PKIFreeCertificateRevocationLists(
    PKICONTEXT *ctx,
    PKICertificateRevocationLists *f);
size_t PKISizeofCertificateRevocationLists (
    PKICONTEXT *ctx,
    PKICertificateRevocationLists *asnstruct,
    int outerSizeFlag);
size_t PKIPackCertificateRevocationLists(
    PKICONTEXT *ctx,
    unsigned char *buf,
    size_t buflen,
    PKICertificateRevocationLists *asnstruct,
    int *erret);
size_t PKIUnpackCertificateRevocationLists(
    PKICONTEXT *ctx,
    PKICertificateRevocationLists **asnstruct,
    unsigned char *buf,
    size_t buflen,
    int *erret);

#define PKINewContentEncryptionAlgorithmIdentifier  (PKIContentEncryptionAlgorithmIdentifier *)PKINewAlgorithmIdentifier
#define PKIFreeContentEncryptionAlgorithmIdentifier PKIFreeAlgorithmIdentifier
#define PKISizeofContentEncryptionAlgorithmIdentifier PKISizeofAlgorithmIdentifier
#define PKIPackContentEncryptionAlgorithmIdentifier PKIPackAlgorithmIdentifier
#define PKIUnpackContentEncryptionAlgorithmIdentifier PKIUnpackAlgorithmIdentifier

PKIContentInfo *PKINewContentInfo(
    PKICONTEXT *ctx);
void PKIFreeContentInfo(
    PKICONTEXT *ctx,
    PKIContentInfo *f);
size_t PKISizeofContentInfo (
    PKICONTEXT *ctx,
    PKIContentInfo *asnstruct,
    int outerSizeFlag);
size_t PKIPackContentInfo(
    PKICONTEXT *ctx,
    unsigned char *buf,
    size_t buflen,
    PKIContentInfo *asnstruct,
    int *erret);
size_t PKIUnpackContentInfo(
    PKICONTEXT *ctx,
    PKIContentInfo **asnstruct,
    unsigned char *buf,
    size_t buflen,
    int *erret);

#define PKINewDigestAlgorithmIdentifier  (PKIDigestAlgorithmIdentifier *)PKINewAlgorithmIdentifier
#define PKIFreeDigestAlgorithmIdentifier PKIFreeAlgorithmIdentifier
#define PKISizeofDigestAlgorithmIdentifier PKISizeofAlgorithmIdentifier
#define PKIPackDigestAlgorithmIdentifier PKIPackAlgorithmIdentifier
#define PKIUnpackDigestAlgorithmIdentifier PKIUnpackAlgorithmIdentifier

#define PKINewDigestEncryptionAlgorithmIdentifier  (PKIDigestEncryptionAlgorithmIdentifier *)PKINewAlgorithmIdentifier
#define PKIFreeDigestEncryptionAlgorithmIdentifier PKIFreeAlgorithmIdentifier
#define PKISizeofDigestEncryptionAlgorithmIdentifier PKISizeofAlgorithmIdentifier
#define PKIPackDigestEncryptionAlgorithmIdentifier PKIPackAlgorithmIdentifier
#define PKIUnpackDigestEncryptionAlgorithmIdentifier PKIUnpackAlgorithmIdentifier

PKIExtendedCertificateInfo *PKINewExtendedCertificateInfo(
    PKICONTEXT *ctx);
void PKIFreeExtendedCertificateInfo(
    PKICONTEXT *ctx,
    PKIExtendedCertificateInfo *f);
size_t PKISizeofExtendedCertificateInfo (
    PKICONTEXT *ctx,
    PKIExtendedCertificateInfo *asnstruct,
    int outerSizeFlag);
size_t PKIPackExtendedCertificateInfo(
    PKICONTEXT *ctx,
    unsigned char *buf,
    size_t buflen,
    PKIExtendedCertificateInfo *asnstruct,
    int *erret);
size_t PKIUnpackExtendedCertificateInfo(
    PKICONTEXT *ctx,
    PKIExtendedCertificateInfo **asnstruct,
    unsigned char *buf,
    size_t buflen,
    int *erret);

PKIIssuerAndSerialNumber *PKINewIssuerAndSerialNumber(
    PKICONTEXT *ctx);
void PKIFreeIssuerAndSerialNumber(
    PKICONTEXT *ctx,
    PKIIssuerAndSerialNumber *f);
size_t PKISizeofIssuerAndSerialNumber (
    PKICONTEXT *ctx,
    PKIIssuerAndSerialNumber *asnstruct,
    int outerSizeFlag);
size_t PKIPackIssuerAndSerialNumber(
    PKICONTEXT *ctx,
    unsigned char *buf,
    size_t buflen,
    PKIIssuerAndSerialNumber *asnstruct,
    int *erret);
size_t PKIUnpackIssuerAndSerialNumber(
    PKICONTEXT *ctx,
    PKIIssuerAndSerialNumber **asnstruct,
    unsigned char *buf,
    size_t buflen,
    int *erret);

#define PKINewKeyEncryptionAlgorithmIdentifier  (PKIKeyEncryptionAlgorithmIdentifier *)PKINewAlgorithmIdentifier
#define PKIFreeKeyEncryptionAlgorithmIdentifier PKIFreeAlgorithmIdentifier
#define PKISizeofKeyEncryptionAlgorithmIdentifier PKISizeofAlgorithmIdentifier
#define PKIPackKeyEncryptionAlgorithmIdentifier PKIPackAlgorithmIdentifier
#define PKIUnpackKeyEncryptionAlgorithmIdentifier PKIUnpackAlgorithmIdentifier

#define PKINewSignatureAlgorithmIdentifier  (PKISignatureAlgorithmIdentifier *)PKINewAlgorithmIdentifier
#define PKIFreeSignatureAlgorithmIdentifier PKIFreeAlgorithmIdentifier
#define PKISizeofSignatureAlgorithmIdentifier PKISizeofAlgorithmIdentifier
#define PKIPackSignatureAlgorithmIdentifier PKIPackAlgorithmIdentifier
#define PKIUnpackSignatureAlgorithmIdentifier PKIUnpackAlgorithmIdentifier

PKIDigestAlgorithmIdentifiers *PKINewDigestAlgorithmIdentifiers(
    PKICONTEXT *ctx);
void PKIFreeDigestAlgorithmIdentifiers(
    PKICONTEXT *ctx,
    PKIDigestAlgorithmIdentifiers *f);
size_t PKISizeofDigestAlgorithmIdentifiers (
    PKICONTEXT *ctx,
    PKIDigestAlgorithmIdentifiers *asnstruct,
    int outerSizeFlag);
size_t PKIPackDigestAlgorithmIdentifiers(
    PKICONTEXT *ctx,
    unsigned char *buf,
    size_t buflen,
    PKIDigestAlgorithmIdentifiers *asnstruct,
    int *erret);
size_t PKIUnpackDigestAlgorithmIdentifiers(
    PKICONTEXT *ctx,
    PKIDigestAlgorithmIdentifiers **asnstruct,
    unsigned char *buf,
    size_t buflen,
    int *erret);

PKIDigestInfo *PKINewDigestInfo(
    PKICONTEXT *ctx);
void PKIFreeDigestInfo(
    PKICONTEXT *ctx,
    PKIDigestInfo *f);
size_t PKISizeofDigestInfo (
    PKICONTEXT *ctx,
    PKIDigestInfo *asnstruct,
    int outerSizeFlag);
size_t PKIPackDigestInfo(
    PKICONTEXT *ctx,
    unsigned char *buf,
    size_t buflen,
    PKIDigestInfo *asnstruct,
    int *erret);
size_t PKIUnpackDigestInfo(
    PKICONTEXT *ctx,
    PKIDigestInfo **asnstruct,
    unsigned char *buf,
    size_t buflen,
    int *erret);

PKIEncryptedContentInfo *PKINewEncryptedContentInfo(
    PKICONTEXT *ctx);
void PKIFreeEncryptedContentInfo(
    PKICONTEXT *ctx,
    PKIEncryptedContentInfo *f);
size_t PKISizeofEncryptedContentInfo (
    PKICONTEXT *ctx,
    PKIEncryptedContentInfo *asnstruct,
    int outerSizeFlag);
size_t PKIPackEncryptedContentInfo(
    PKICONTEXT *ctx,
    unsigned char *buf,
    size_t buflen,
    PKIEncryptedContentInfo *asnstruct,
    int *erret);
size_t PKIUnpackEncryptedContentInfo(
    PKICONTEXT *ctx,
    PKIEncryptedContentInfo **asnstruct,
    unsigned char *buf,
    size_t buflen,
    int *erret);

PKIExtendedCertificate *PKINewExtendedCertificate(
    PKICONTEXT *ctx);
void PKIFreeExtendedCertificate(
    PKICONTEXT *ctx,
    PKIExtendedCertificate *f);
size_t PKISizeofExtendedCertificate (
    PKICONTEXT *ctx,
    PKIExtendedCertificate *asnstruct,
    int outerSizeFlag);
size_t PKIPackExtendedCertificate(
    PKICONTEXT *ctx,
    unsigned char *buf,
    size_t buflen,
    PKIExtendedCertificate *asnstruct,
    int *erret);
size_t PKIUnpackExtendedCertificate(
    PKICONTEXT *ctx,
    PKIExtendedCertificate **asnstruct,
    unsigned char *buf,
    size_t buflen,
    int *erret);

PKIRecipientInfo *PKINewRecipientInfo(
    PKICONTEXT *ctx);
void PKIFreeRecipientInfo(
    PKICONTEXT *ctx,
    PKIRecipientInfo *f);
size_t PKISizeofRecipientInfo (
    PKICONTEXT *ctx,
    PKIRecipientInfo *asnstruct,
    int outerSizeFlag);
size_t PKIPackRecipientInfo(
    PKICONTEXT *ctx,
    unsigned char *buf,
    size_t buflen,
    PKIRecipientInfo *asnstruct,
    int *erret);
size_t PKIUnpackRecipientInfo(
    PKICONTEXT *ctx,
    PKIRecipientInfo **asnstruct,
    unsigned char *buf,
    size_t buflen,
    int *erret);

PKISignerInfo *PKINewSignerInfo(
    PKICONTEXT *ctx);
void PKIFreeSignerInfo(
    PKICONTEXT *ctx,
    PKISignerInfo *f);
size_t PKISizeofSignerInfo (
    PKICONTEXT *ctx,
    PKISignerInfo *asnstruct,
    int outerSizeFlag);
size_t PKIPackSignerInfo(
    PKICONTEXT *ctx,
    unsigned char *buf,
    size_t buflen,
    PKISignerInfo *asnstruct,
    int *erret);
size_t PKIUnpackSignerInfo(
    PKICONTEXT *ctx,
    PKISignerInfo **asnstruct,
    unsigned char *buf,
    size_t buflen,
    int *erret);

PKIEncryptedData *PKINewEncryptedData(
    PKICONTEXT *ctx);
void PKIFreeEncryptedData(
    PKICONTEXT *ctx,
    PKIEncryptedData *f);
size_t PKISizeofEncryptedData (
    PKICONTEXT *ctx,
    PKIEncryptedData *asnstruct,
    int outerSizeFlag);
size_t PKIPackEncryptedData(
    PKICONTEXT *ctx,
    unsigned char *buf,
    size_t buflen,
    PKIEncryptedData *asnstruct,
    int *erret);
size_t PKIUnpackEncryptedData(
    PKICONTEXT *ctx,
    PKIEncryptedData **asnstruct,
    unsigned char *buf,
    size_t buflen,
    int *erret);

PKIExtendedCertificateOrCertificate *PKINewExtendedCertificateOrCertificate(
    PKICONTEXT *ctx);
void PKIFreeExtendedCertificateOrCertificate(
    PKICONTEXT *ctx,
    PKIExtendedCertificateOrCertificate *f);
size_t PKISizeofExtendedCertificateOrCertificate (
    PKICONTEXT *ctx,
    PKIExtendedCertificateOrCertificate *asnstruct,
    int outerSizeFlag);
size_t PKIPackExtendedCertificateOrCertificate(
    PKICONTEXT *ctx,
    unsigned char *buf,
    size_t buflen,
    PKIExtendedCertificateOrCertificate *asnstruct,
    int *erret);
size_t PKIUnpackExtendedCertificateOrCertificate(
    PKICONTEXT *ctx,
    PKIExtendedCertificateOrCertificate **asnstruct,
    unsigned char *buf,
    size_t buflen,
    int *erret);

PKIRecipientInfos *PKINewRecipientInfos(
    PKICONTEXT *ctx);
void PKIFreeRecipientInfos(
    PKICONTEXT *ctx,
    PKIRecipientInfos *f);
size_t PKISizeofRecipientInfos (
    PKICONTEXT *ctx,
    PKIRecipientInfos *asnstruct,
    int outerSizeFlag);
size_t PKIPackRecipientInfos(
    PKICONTEXT *ctx,
    unsigned char *buf,
    size_t buflen,
    PKIRecipientInfos *asnstruct,
    int *erret);
size_t PKIUnpackRecipientInfos(
    PKICONTEXT *ctx,
    PKIRecipientInfos **asnstruct,
    unsigned char *buf,
    size_t buflen,
    int *erret);

PKISignerInfos *PKINewSignerInfos(
    PKICONTEXT *ctx);
void PKIFreeSignerInfos(
    PKICONTEXT *ctx,
    PKISignerInfos *f);
size_t PKISizeofSignerInfos (
    PKICONTEXT *ctx,
    PKISignerInfos *asnstruct,
    int outerSizeFlag);
size_t PKIPackSignerInfos(
    PKICONTEXT *ctx,
    unsigned char *buf,
    size_t buflen,
    PKISignerInfos *asnstruct,
    int *erret);
size_t PKIUnpackSignerInfos(
    PKICONTEXT *ctx,
    PKISignerInfos **asnstruct,
    unsigned char *buf,
    size_t buflen,
    int *erret);

PKIEnvelopedData *PKINewEnvelopedData(
    PKICONTEXT *ctx);
void PKIFreeEnvelopedData(
    PKICONTEXT *ctx,
    PKIEnvelopedData *f);
size_t PKISizeofEnvelopedData (
    PKICONTEXT *ctx,
    PKIEnvelopedData *asnstruct,
    int outerSizeFlag);
size_t PKIPackEnvelopedData(
    PKICONTEXT *ctx,
    unsigned char *buf,
    size_t buflen,
    PKIEnvelopedData *asnstruct,
    int *erret);
size_t PKIUnpackEnvelopedData(
    PKICONTEXT *ctx,
    PKIEnvelopedData **asnstruct,
    unsigned char *buf,
    size_t buflen,
    int *erret);

PKIExtendedCertificatesAndCertificates *PKINewExtendedCertificatesAndCertificates(
    PKICONTEXT *ctx);
void PKIFreeExtendedCertificatesAndCertificates(
    PKICONTEXT *ctx,
    PKIExtendedCertificatesAndCertificates *f);
size_t PKISizeofExtendedCertificatesAndCertificates (
    PKICONTEXT *ctx,
    PKIExtendedCertificatesAndCertificates *asnstruct,
    int outerSizeFlag);
size_t PKIPackExtendedCertificatesAndCertificates(
    PKICONTEXT *ctx,
    unsigned char *buf,
    size_t buflen,
    PKIExtendedCertificatesAndCertificates *asnstruct,
    int *erret);
size_t PKIUnpackExtendedCertificatesAndCertificates(
    PKICONTEXT *ctx,
    PKIExtendedCertificatesAndCertificates **asnstruct,
    unsigned char *buf,
    size_t buflen,
    int *erret);

PKISignedData *PKINewSignedData(
    PKICONTEXT *ctx);
void PKIFreeSignedData(
    PKICONTEXT *ctx,
    PKISignedData *f);
size_t PKISizeofSignedData (
    PKICONTEXT *ctx,
    PKISignedData *asnstruct,
    int outerSizeFlag);
size_t PKIPackSignedData(
    PKICONTEXT *ctx,
    unsigned char *buf,
    size_t buflen,
    PKISignedData *asnstruct,
    int *erret);
size_t PKIUnpackSignedData(
    PKICONTEXT *ctx,
    PKISignedData **asnstruct,
    unsigned char *buf,
    size_t buflen,
    int *erret);

#endif /* pkcs7_ASN_H_ */
