📄 pkcs7_asn.c
字号:
} /* PKINewRecipientInfo */
void PKIFreeRecipientInfo(
PKICONTEXT *ctx,
PKIRecipientInfo *f)
{
if (ctx == NULL)
return;
PKIDropInPlaceRecipientInfo(ctx, f);
if (f != NULL)
PKIFree(ctx->memMgr, f);
} /* PKIFreeRecipientInfo */
size_t PKISizeofRecipientInfo(
PKICONTEXT *ctx,
PKIRecipientInfo *asnstruct,
int outerSizeFlag)
{
(void)ctx; /* for future use */
return(PKISizeofRecipientInfoInternal(asnstruct, outerSizeFlag, PKIFALSE));
} /* PKISizeofRecipientInfo */
size_t PKIPackRecipientInfo(
PKICONTEXT *ctx,
unsigned char *buf,
size_t buflen,
PKIRecipientInfo *asnstruct,
int *erret )
{
return(PKIPackRecipientInfoInternal(ctx, buf, buflen, asnstruct, PKIID_RecipientInfo, erret));
} /* PKIPackRecipientInfo */
size_t PKIUnpackRecipientInfo(
PKICONTEXT *ctx,
PKIRecipientInfo **asnstruct,
unsigned char *buf,
size_t buflen,
int *erret)
{
return(PKIUnpackRecipientInfoInternal(ctx, asnstruct, buf, buflen,
PKIID_RecipientInfo, erret));
}
/******************************************************************
* Routines for SignerInfo
******************************************************************/
PKISignerInfo *PKINewSignerInfo(
PKICONTEXT *ctx)
{
PKISignerInfo *f;
if (ctx == NULL)
return NULL;
f = (PKISignerInfo *)PKIAlloc(ctx->memMgr, sizeof(PKISignerInfo));
if (f != NULL)
(void)memset(f, 0, sizeof(PKISignerInfo));
return (f);
} /* PKINewSignerInfo */
void PKIFreeSignerInfo(
PKICONTEXT *ctx,
PKISignerInfo *f)
{
if (ctx == NULL)
return;
PKIDropInPlaceSignerInfo(ctx, f);
if (f != NULL)
PKIFree(ctx->memMgr, f);
} /* PKIFreeSignerInfo */
size_t PKISizeofSignerInfo(
PKICONTEXT *ctx,
PKISignerInfo *asnstruct,
int outerSizeFlag)
{
(void)ctx; /* for future use */
return(PKISizeofSignerInfoInternal(asnstruct, outerSizeFlag, PKIFALSE));
} /* PKISizeofSignerInfo */
size_t PKIPackSignerInfo(
PKICONTEXT *ctx,
unsigned char *buf,
size_t buflen,
PKISignerInfo *asnstruct,
int *erret )
{
return(PKIPackSignerInfoInternal(ctx, buf, buflen, asnstruct, PKIID_SignerInfo, erret));
} /* PKIPackSignerInfo */
size_t PKIUnpackSignerInfo(
PKICONTEXT *ctx,
PKISignerInfo **asnstruct,
unsigned char *buf,
size_t buflen,
int *erret)
{
return(PKIUnpackSignerInfoInternal(ctx, asnstruct, buf, buflen,
PKIID_SignerInfo, erret));
}
/******************************************************************
* Routines for EncryptedData
******************************************************************/
PKIEncryptedData *PKINewEncryptedData(
PKICONTEXT *ctx)
{
PKIEncryptedData *f;
if (ctx == NULL)
return NULL;
f = (PKIEncryptedData *)PKIAlloc(ctx->memMgr, sizeof(PKIEncryptedData));
if (f != NULL)
(void)memset(f, 0, sizeof(PKIEncryptedData));
return (f);
} /* PKINewEncryptedData */
void PKIFreeEncryptedData(
PKICONTEXT *ctx,
PKIEncryptedData *f)
{
if (ctx == NULL)
return;
PKIDropInPlaceEncryptedData(ctx, f);
if (f != NULL)
PKIFree(ctx->memMgr, f);
} /* PKIFreeEncryptedData */
size_t PKISizeofEncryptedData(
PKICONTEXT *ctx,
PKIEncryptedData *asnstruct,
int outerSizeFlag)
{
(void)ctx; /* for future use */
return(PKISizeofEncryptedDataInternal(asnstruct, outerSizeFlag, PKIFALSE));
} /* PKISizeofEncryptedData */
size_t PKIPackEncryptedData(
PKICONTEXT *ctx,
unsigned char *buf,
size_t buflen,
PKIEncryptedData *asnstruct,
int *erret )
{
return(PKIPackEncryptedDataInternal(ctx, buf, buflen, asnstruct, PKIID_EncryptedData, erret));
} /* PKIPackEncryptedData */
size_t PKIUnpackEncryptedData(
PKICONTEXT *ctx,
PKIEncryptedData **asnstruct,
unsigned char *buf,
size_t buflen,
int *erret)
{
return(PKIUnpackEncryptedDataInternal(ctx, asnstruct, buf, buflen,
PKIID_EncryptedData, erret));
}
/******************************************************************
* Routines for ExtendedCertificateOrCertificate
******************************************************************/
PKIExtendedCertificateOrCertificate *PKINewExtendedCertificateOrCertificate(
PKICONTEXT *ctx)
{
PKIExtendedCertificateOrCertificate *f;
if (ctx == NULL)
return NULL;
f = (PKIExtendedCertificateOrCertificate *)PKIAlloc(ctx->memMgr, sizeof(PKIExtendedCertificateOrCertificate));
if (f != NULL)
(void)memset(f, 0, sizeof(PKIExtendedCertificateOrCertificate));
return (f);
} /* PKINewExtendedCertificateOrCertificate */
void PKIFreeExtendedCertificateOrCertificate(
PKICONTEXT *ctx,
PKIExtendedCertificateOrCertificate *f)
{
if (ctx == NULL)
return;
PKIDropInPlaceExtendedCertificateOrCertificate(ctx, f);
if (f != NULL)
PKIFree(ctx->memMgr, f);
} /* PKIFreeExtendedCertificateOrCertificate */
size_t PKISizeofExtendedCertificateOrCertificate(
PKICONTEXT *ctx,
PKIExtendedCertificateOrCertificate *asnstruct,
int outerSizeFlag)
{
(void)ctx; /* for future use */
return(PKISizeofExtendedCertificateOrCertificateInternal(asnstruct, outerSizeFlag, PKIFALSE));
} /* PKISizeofExtendedCertificateOrCertificate */
size_t PKIPackExtendedCertificateOrCertificate(
PKICONTEXT *ctx,
unsigned char *buf,
size_t buflen,
PKIExtendedCertificateOrCertificate *asnstruct,
int *erret )
{
return(PKIPackExtendedCertificateOrCertificateInternal(ctx, buf, buflen, asnstruct, PKIID_ExtendedCertificateOrCertificate, erret));
} /* PKIPackExtendedCertificateOrCertificate */
size_t PKIUnpackExtendedCertificateOrCertificate(
PKICONTEXT *ctx,
PKIExtendedCertificateOrCertificate **asnstruct,
unsigned char *buf,
size_t buflen,
int *erret)
{
return(PKIUnpackExtendedCertificateOrCertificateInternal(ctx, asnstruct, buf, buflen,
PKIID_ExtendedCertificateOrCertificate, erret));
}
/******************************************************************
* Routines for RecipientInfos
******************************************************************/
PKIRecipientInfos *PKINewRecipientInfos(
PKICONTEXT *ctx)
{
PKIRecipientInfos *f;
if (ctx == NULL)
return NULL;
f = (PKIRecipientInfos *)PKIAlloc(ctx->memMgr, sizeof(PKIRecipientInfos));
if (f != NULL)
(void)memset(f, 0, sizeof(PKIRecipientInfos));
return (f);
} /* PKINewRecipientInfos */
void PKIFreeRecipientInfos(
PKICONTEXT *ctx,
PKIRecipientInfos *f)
{
if (ctx == NULL)
return;
PKIDropInPlaceRecipientInfos(ctx, f);
if (f != NULL)
PKIFree(ctx->memMgr, f);
} /* PKIFreeRecipientInfos */
size_t PKISizeofRecipientInfos(
PKICONTEXT *ctx,
PKIRecipientInfos *asnstruct,
int outerSizeFlag)
{
(void)ctx; /* for future use */
return(PKISizeofRecipientInfosInternal(asnstruct, outerSizeFlag, PKIFALSE));
} /* PKISizeofRecipientInfos */
size_t PKIPackRecipientInfos(
PKICONTEXT *ctx,
unsigned char *buf,
size_t buflen,
PKIRecipientInfos *asnstruct,
int *erret )
{
return(PKIPackRecipientInfosInternal(ctx, buf, buflen, asnstruct, PKIID_RecipientInfos, erret));
} /* PKIPackRecipientInfos */
size_t PKIUnpackRecipientInfos(
PKICONTEXT *ctx,
PKIRecipientInfos **asnstruct,
unsigned char *buf,
size_t buflen,
int *erret)
{
return(PKIUnpackRecipientInfosInternal(ctx, asnstruct, buf, buflen,
PKIID_RecipientInfos, erret));
}
/******************************************************************
* Routines for SignerInfos
******************************************************************/
PKISignerInfos *PKINewSignerInfos(
PKICONTEXT *ctx)
{
PKISignerInfos *f;
if (ctx == NULL)
return NULL;
f = (PKISignerInfos *)PKIAlloc(ctx->memMgr, sizeof(PKISignerInfos));
if (f != NULL)
(void)memset(f, 0, sizeof(PKISignerInfos));
return (f);
} /* PKINewSignerInfos */
void PKIFreeSignerInfos(
PKICONTEXT *ctx,
PKISignerInfos *f)
{
if (ctx == NULL)
return;
PKIDropInPlaceSignerInfos(ctx, f);
if (f != NULL)
PKIFree(ctx->memMgr, f);
} /* PKIFreeSignerInfos */
size_t PKISizeofSignerInfos(
PKICONTEXT *ctx,
PKISignerInfos *asnstruct,
int outerSizeFlag)
{
(void)ctx; /* for future use */
return(PKISizeofSignerInfosInternal(asnstruct, outerSizeFlag, PKIFALSE));
} /* PKISizeofSignerInfos */
size_t PKIPackSignerInfos(
PKICONTEXT *ctx,
unsigned char *buf,
size_t buflen,
PKISignerInfos *asnstruct,
int *erret )
{
return(PKIPackSignerInfosInternal(ctx, buf, buflen, asnstruct, PKIID_SignerInfos, erret));
} /* PKIPackSignerInfos */
size_t PKIUnpackSignerInfos(
PKICONTEXT *ctx,
PKISignerInfos **asnstruct,
unsigned char *buf,
size_t buflen,
int *erret)
{
return(PKIUnpackSignerInfosInternal(ctx, asnstruct, buf, buflen,
PKIID_SignerInfos, erret));
}
/******************************************************************
* Routines for EnvelopedData
******************************************************************/
PKIEnvelopedData *PKINewEnvelopedData(
PKICONTEXT *ctx)
{
PKIEnvelopedData *f;
if (ctx == NULL)
return NULL;
f = (PKIEnvelopedData *)PKIAlloc(ctx->memMgr, sizeof(PKIEnvelopedData));
if (f != NULL)
(void)memset(f, 0, sizeof(PKIEnvelopedData));
return (f);
} /* PKINewEnvelopedData */
void PKIFreeEnvelopedData(
PKICONTEXT *ctx,
PKIEnvelopedData *f)
{
if (ctx == NULL)
return;
PKIDropInPlaceEnvelopedData(ctx, f);
if (f != NULL)
PKIFree(ctx->memMgr, f);
} /* PKIFreeEnvelopedData */
size_t PKISizeofEnvelopedData(
PKICONTEXT *ctx,
PKIEnvelopedData *asnstruct,
int outerSizeFlag)
{
(void)ctx; /* for future use */
return(PKISizeofEnvelopedDataInternal(asnstruct, outerSizeFlag, PKIFALSE));
} /* PKISizeofEnvelopedData */
size_t PKIPackEnvelopedData(
PKICONTEXT *ctx,
unsigned char *buf,
size_t buflen,
PKIEnvelopedData *asnstruct,
int *erret )
{
return(PKIPackEnvelopedDataInternal(ctx, buf, buflen, asnstruct, PKIID_EnvelopedData, erret));
} /* PKIPackEnvelopedData */
size_t PKIUnpackEnvelopedData(
PKICONTEXT *ctx,
PKIEnvelopedData **asnstruct,
unsigned char *buf,
size_t buflen,
int *erret)
{
return(PKIUnpackEnvelopedDataInternal(ctx, asnstruct, buf, buflen,
PKIID_EnvelopedData, erret));
}
/******************************************************************
* Routines for ExtendedCertificatesAndCertificates
******************************************************************/
PKIExtendedCertificatesAndCertificates *PKINewExtendedCertificatesAndCertificates(
PKICONTEXT *ctx)
{
PKIExtendedCertificatesAndCertificates *f;
if (ctx == NULL)
return NULL;
f = (PKIExtendedCertificatesAndCertificates *)PKIAlloc(ctx->memMgr, sizeof(PKIExtendedCertificatesAndCertificates));
if (f != NULL)
(void)memset(f, 0, sizeof(PKIExtendedCertificatesAndCertificates));
return (f);
} /* PKINewExtendedCertificatesAndCertificates */
void PKIFreeExtendedCertificatesAndCertificates(
PKICONTEXT *ctx,
PKIExtendedCertificatesAndCertificates *f)
{
if (ctx == NULL)
return;
PKIDropInPlaceExtendedCertificatesAndCertificates(ctx, f);
if (f != NULL)
PKIFree(ctx->memMgr, f);
} /* PKIFreeExtendedCertificatesAndCertificates */
size_t PKISizeofExtendedCertificatesAndCertificates(
PKICONTEXT *ctx,
PKIExtendedCertificatesAndCertificates *asnstruct,
int outerSizeFlag)
{
(void)ctx; /* for future use */
return(PKISizeofExtendedCertificatesAndCertificatesInternal(asnstruct, outerSizeFlag, PKIFALSE));
} /* PKISizeofExtendedCertificatesAndCertificates */
size_t PKIPackExtendedCertificatesAndCertificates(
PKICONTEXT *ctx,
unsigned char *buf,
size_t buflen,
PKIExtendedCertificatesAndCertificates *asnstruct,
int *erret )
{
return(PKIPackExtendedCertificatesAndCertificatesInternal(ctx, buf, buflen, asnstruct, PKIID_ExtendedCertificatesAndCertificates, erret));
} /* PKIPackExtendedCertificatesAndCertificates */
size_t PKIUnpackExtendedCertificatesAndCertificates(
PKICONTEXT *ctx,
PKIExtendedCertificatesAndCertificates **asnstruct,
unsigned char *buf,
size_t buflen,
int *erret)
{
return(PKIUnpackExtendedCertificatesAndCertificatesInternal(ctx, asnstruct, buf, buflen,
PKIID_ExtendedCertificatesAndCertificates, erret));
}
/******************************************************************
* Routines for SignedData
******************************************************************/
PKISignedData *PKINewSignedData(
PKICONTEXT *ctx)
{
PKISignedData *f;
if (ctx == NULL)
return NULL;
f = (PKISignedData *)PKIAlloc(ctx->memMgr, sizeof(PKISignedData));
if (f != NULL)
(void)memset(f, 0, sizeof(PKISignedData));
return (f);
} /* PKINewSignedData */
void PKIFreeSignedData(
PKICONTEXT *ctx,
PKISignedData *f)
{
if (ctx == NULL)
return;
PKIDropInPlaceSignedData(ctx, f);
if (f != NULL)
PKIFree(ctx->memMgr, f);
} /* PKIFreeSignedData */
size_t PKISizeofSignedData(
PKICONTEXT *ctx,
PKISignedData *asnstruct,
int outerSizeFlag)
{
(void)ctx; /* for future use */
return(PKISizeofSignedDataInternal(asnstruct, outerSizeFlag, PKIFALSE));
} /* PKISizeofSignedData */
size_t PKIPackSignedData(
PKICONTEXT *ctx,
unsigned char *buf,
size_t buflen,
PKISignedData *asnstruct,
int *erret )
{
return(PKIPackSignedDataInternal(ctx, buf, buflen, asnstruct, PKIID_SignedData, erret));
} /* PKIPackSignedData */
size_t PKIUnpackSignedData(
PKICONTEXT *ctx,
PKISignedData **asnstruct,
unsigned char *buf,
size_t buflen,
int *erret)
{
return(PKIUnpackSignedDataInternal(ctx, asnstruct, buf, buflen,
PKIID_SignedData, erret));
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -