📄 pgpx509cert_asn.c
字号:
if(*erret==0 && bytesused==0)
PGPASN_ERR(kPGPASNError_ErrUnpackUnderrun);
return bytesused;
}
/******************************************************************
* Routines for RevokedCertificate
******************************************************************/
PGPASN_RevokedCertificate *pgpasn_NewRevokedCertificate(
PGPASN_CONTEXT *ctx)
{
PGPASN_RevokedCertificate *f;
if (ctx == NULL)
return NULL;
f = (PGPASN_RevokedCertificate *)PGPASN_Alloc(ctx->memMgr, sizeof(PGPASN_RevokedCertificate));
if (f != NULL)
(void)memset(f, 0, sizeof(PGPASN_RevokedCertificate));
return (f);
} /* pgpasn_NewRevokedCertificate */
void pgpasn_FreeRevokedCertificate(
PGPASN_CONTEXT *ctx,
PGPASN_RevokedCertificate *f)
{
if (ctx == NULL)
return;
pgpasn_DropInPlaceRevokedCertificate(ctx, f);
if (f != NULL)
PGPASN_Free(ctx->memMgr, f);
} /* pgpasn_FreeRevokedCertificate */
size_t pgpasn_SizeofRevokedCertificate(
PGPASN_CONTEXT *ctx,
PGPASN_RevokedCertificate *asnstruct,
int outerSizeFlag)
{
(void)ctx; /* for future use */
return(pgpasn_SizeofRevokedCertificateInternal(asnstruct, outerSizeFlag, PGPASN_FALSE));
} /* pgpasn_SizeofRevokedCertificate */
size_t pgpasn_PackRevokedCertificate(
PGPASN_CONTEXT *ctx,
unsigned char *buf,
size_t buflen,
PGPASN_RevokedCertificate *asnstruct,
int *erret )
{
return(pgpasn_PackRevokedCertificateInternal(ctx, buf, buflen, asnstruct, PGPASN_ID_RevokedCertificate, erret));
} /* pgpasn_PackRevokedCertificate */
size_t pgpasn_UnpackRevokedCertificate(
PGPASN_CONTEXT *ctx,
PGPASN_RevokedCertificate **asnstruct,
const unsigned char *buf,
size_t buflen,
int *erret)
{
size_t bytesused;
bytesused=pgpasn_UnpackRevokedCertificateInternal(ctx, asnstruct, buf, buflen,
PGPASN_ID_RevokedCertificate, erret);
if(*erret==0 && bytesused==0)
PGPASN_ERR(kPGPASNError_ErrUnpackUnderrun);
return bytesused;
}
/******************************************************************
* Routines for XTBSCertificate
******************************************************************/
PGPASN_XTBSCertificate *pgpasn_NewXTBSCertificate(
PGPASN_CONTEXT *ctx)
{
PGPASN_XTBSCertificate *f;
if (ctx == NULL)
return NULL;
f = (PGPASN_XTBSCertificate *)PGPASN_Alloc(ctx->memMgr, sizeof(PGPASN_XTBSCertificate));
if (f != NULL)
(void)memset(f, 0, sizeof(PGPASN_XTBSCertificate));
return (f);
} /* pgpasn_NewXTBSCertificate */
void pgpasn_FreeXTBSCertificate(
PGPASN_CONTEXT *ctx,
PGPASN_XTBSCertificate *f)
{
if (ctx == NULL)
return;
pgpasn_DropInPlaceXTBSCertificate(ctx, f);
if (f != NULL)
PGPASN_Free(ctx->memMgr, f);
} /* pgpasn_FreeXTBSCertificate */
size_t pgpasn_SizeofXTBSCertificate(
PGPASN_CONTEXT *ctx,
PGPASN_XTBSCertificate *asnstruct,
int outerSizeFlag)
{
(void)ctx; /* for future use */
return(pgpasn_SizeofXTBSCertificateInternal(asnstruct, outerSizeFlag, PGPASN_FALSE));
} /* pgpasn_SizeofXTBSCertificate */
size_t pgpasn_PackXTBSCertificate(
PGPASN_CONTEXT *ctx,
unsigned char *buf,
size_t buflen,
PGPASN_XTBSCertificate *asnstruct,
int *erret )
{
return(pgpasn_PackXTBSCertificateInternal(ctx, buf, buflen, asnstruct, PGPASN_ID_XTBSCertificate, erret));
} /* pgpasn_PackXTBSCertificate */
size_t pgpasn_UnpackXTBSCertificate(
PGPASN_CONTEXT *ctx,
PGPASN_XTBSCertificate **asnstruct,
const unsigned char *buf,
size_t buflen,
int *erret)
{
size_t bytesused;
bytesused=pgpasn_UnpackXTBSCertificateInternal(ctx, asnstruct, buf, buflen,
PGPASN_ID_XTBSCertificate, erret);
if(*erret==0 && bytesused==0)
PGPASN_ERR(kPGPASNError_ErrUnpackUnderrun);
return bytesused;
}
/******************************************************************
* Routines for Name
******************************************************************/
PGPASN_Name *pgpasn_NewName(
PGPASN_CONTEXT *ctx)
{
PGPASN_Name *f;
if (ctx == NULL)
return NULL;
f = (PGPASN_Name *)PGPASN_Alloc(ctx->memMgr, sizeof(PGPASN_Name));
if (f != NULL)
(void)memset(f, 0, sizeof(PGPASN_Name));
return (f);
} /* pgpasn_NewName */
void pgpasn_FreeName(
PGPASN_CONTEXT *ctx,
PGPASN_Name *f)
{
if (ctx == NULL)
return;
pgpasn_DropInPlaceName(ctx, f);
if (f != NULL)
PGPASN_Free(ctx->memMgr, f);
} /* pgpasn_FreeName */
size_t pgpasn_SizeofName(
PGPASN_CONTEXT *ctx,
PGPASN_Name *asnstruct,
int outerSizeFlag)
{
(void)ctx; /* for future use */
return(pgpasn_SizeofNameInternal(asnstruct, outerSizeFlag, PGPASN_FALSE));
} /* pgpasn_SizeofName */
size_t pgpasn_PackName(
PGPASN_CONTEXT *ctx,
unsigned char *buf,
size_t buflen,
PGPASN_Name *asnstruct,
int *erret )
{
return(pgpasn_PackNameInternal(ctx, buf, buflen, asnstruct, PGPASN_ID_Name, erret));
} /* pgpasn_PackName */
size_t pgpasn_UnpackName(
PGPASN_CONTEXT *ctx,
PGPASN_Name **asnstruct,
const unsigned char *buf,
size_t buflen,
int *erret)
{
size_t bytesused;
bytesused=pgpasn_UnpackNameInternal(ctx, asnstruct, buf, buflen,
PGPASN_ID_Name, erret);
if(*erret==0 && bytesused==0)
PGPASN_ERR(kPGPASNError_ErrUnpackUnderrun);
return bytesused;
}
/******************************************************************
* Routines for PrivateKeyInfo
******************************************************************/
PGPASN_PrivateKeyInfo *pgpasn_NewPrivateKeyInfo(
PGPASN_CONTEXT *ctx)
{
PGPASN_PrivateKeyInfo *f;
if (ctx == NULL)
return NULL;
f = (PGPASN_PrivateKeyInfo *)PGPASN_Alloc(ctx->memMgr, sizeof(PGPASN_PrivateKeyInfo));
if (f != NULL)
(void)memset(f, 0, sizeof(PGPASN_PrivateKeyInfo));
return (f);
} /* pgpasn_NewPrivateKeyInfo */
void pgpasn_FreePrivateKeyInfo(
PGPASN_CONTEXT *ctx,
PGPASN_PrivateKeyInfo *f)
{
if (ctx == NULL)
return;
pgpasn_DropInPlacePrivateKeyInfo(ctx, f);
if (f != NULL)
PGPASN_Free(ctx->memMgr, f);
} /* pgpasn_FreePrivateKeyInfo */
size_t pgpasn_SizeofPrivateKeyInfo(
PGPASN_CONTEXT *ctx,
PGPASN_PrivateKeyInfo *asnstruct,
int outerSizeFlag)
{
(void)ctx; /* for future use */
return(pgpasn_SizeofPrivateKeyInfoInternal(asnstruct, outerSizeFlag, PGPASN_FALSE));
} /* pgpasn_SizeofPrivateKeyInfo */
size_t pgpasn_PackPrivateKeyInfo(
PGPASN_CONTEXT *ctx,
unsigned char *buf,
size_t buflen,
PGPASN_PrivateKeyInfo *asnstruct,
int *erret )
{
return(pgpasn_PackPrivateKeyInfoInternal(ctx, buf, buflen, asnstruct, PGPASN_ID_PrivateKeyInfo, erret));
} /* pgpasn_PackPrivateKeyInfo */
size_t pgpasn_UnpackPrivateKeyInfo(
PGPASN_CONTEXT *ctx,
PGPASN_PrivateKeyInfo **asnstruct,
const unsigned char *buf,
size_t buflen,
int *erret)
{
size_t bytesused;
bytesused=pgpasn_UnpackPrivateKeyInfoInternal(ctx, asnstruct, buf, buflen,
PGPASN_ID_PrivateKeyInfo, erret);
if(*erret==0 && bytesused==0)
PGPASN_ERR(kPGPASNError_ErrUnpackUnderrun);
return bytesused;
}
/******************************************************************
* Routines for revokedCertificates_SEQ_OF
******************************************************************/
PGPASN_revokedCertificates_SEQ_OF *pgpasn_NewrevokedCertificates_SEQ_OF(
PGPASN_CONTEXT *ctx)
{
PGPASN_revokedCertificates_SEQ_OF *f;
if (ctx == NULL)
return NULL;
f = (PGPASN_revokedCertificates_SEQ_OF *)PGPASN_Alloc(ctx->memMgr, sizeof(PGPASN_revokedCertificates_SEQ_OF));
if (f != NULL)
(void)memset(f, 0, sizeof(PGPASN_revokedCertificates_SEQ_OF));
return (f);
} /* pgpasn_NewrevokedCertificates_SEQ_OF */
void pgpasn_FreerevokedCertificates_SEQ_OF(
PGPASN_CONTEXT *ctx,
PGPASN_revokedCertificates_SEQ_OF *f)
{
if (ctx == NULL)
return;
pgpasn_DropInPlacerevokedCertificates_SEQ_OF(ctx, f);
if (f != NULL)
PGPASN_Free(ctx->memMgr, f);
} /* pgpasn_FreerevokedCertificates_SEQ_OF */
size_t pgpasn_SizeofrevokedCertificates_SEQ_OF(
PGPASN_CONTEXT *ctx,
PGPASN_revokedCertificates_SEQ_OF *asnstruct,
int outerSizeFlag)
{
(void)ctx; /* for future use */
return(pgpasn_SizeofrevokedCertificates_SEQ_OFInternal(asnstruct, outerSizeFlag, PGPASN_FALSE));
} /* pgpasn_SizeofrevokedCertificates_SEQ_OF */
size_t pgpasn_PackrevokedCertificates_SEQ_OF(
PGPASN_CONTEXT *ctx,
unsigned char *buf,
size_t buflen,
PGPASN_revokedCertificates_SEQ_OF *asnstruct,
int *erret )
{
return(pgpasn_PackrevokedCertificates_SEQ_OFInternal(ctx, buf, buflen, asnstruct, PGPASN_ID_revokedCertificates_SEQ_OF, erret));
} /* pgpasn_PackrevokedCertificates_SEQ_OF */
size_t pgpasn_UnpackrevokedCertificates_SEQ_OF(
PGPASN_CONTEXT *ctx,
PGPASN_revokedCertificates_SEQ_OF **asnstruct,
const unsigned char *buf,
size_t buflen,
int *erret)
{
size_t bytesused;
bytesused=pgpasn_UnpackrevokedCertificates_SEQ_OFInternal(ctx, asnstruct, buf, buflen,
PGPASN_ID_revokedCertificates_SEQ_OF, erret);
if(*erret==0 && bytesused==0)
PGPASN_ERR(kPGPASNError_ErrUnpackUnderrun);
return bytesused;
}
/******************************************************************
* Routines for CertificationRequestInfo
******************************************************************/
PGPASN_CertificationRequestInfo *pgpasn_NewCertificationRequestInfo(
PGPASN_CONTEXT *ctx)
{
PGPASN_CertificationRequestInfo *f;
if (ctx == NULL)
return NULL;
f = (PGPASN_CertificationRequestInfo *)PGPASN_Alloc(ctx->memMgr, sizeof(PGPASN_CertificationRequestInfo));
if (f != NULL)
(void)memset(f, 0, sizeof(PGPASN_CertificationRequestInfo));
return (f);
} /* pgpasn_NewCertificationRequestInfo */
void pgpasn_FreeCertificationRequestInfo(
PGPASN_CONTEXT *ctx,
PGPASN_CertificationRequestInfo *f)
{
if (ctx == NULL)
return;
pgpasn_DropInPlaceCertificationRequestInfo(ctx, f);
if (f != NULL)
PGPASN_Free(ctx->memMgr, f);
} /* pgpasn_FreeCertificationRequestInfo */
size_t pgpasn_SizeofCertificationRequestInfo(
PGPASN_CONTEXT *ctx,
PGPASN_CertificationRequestInfo *asnstruct,
int outerSizeFlag)
{
(void)ctx; /* for future use */
return(pgpasn_SizeofCertificationRequestInfoInternal(asnstruct, outerSizeFlag, PGPASN_FALSE));
} /* pgpasn_SizeofCertificationRequestInfo */
size_t pgpasn_PackCertificationRequestInfo(
PGPASN_CONTEXT *ctx,
unsigned char *buf,
size_t buflen,
PGPASN_CertificationRequestInfo *asnstruct,
int *erret )
{
return(pgpasn_PackCertificationRequestInfoInternal(ctx, buf, buflen, asnstruct, PGPASN_ID_CertificationRequestInfo, erret));
} /* pgpasn_PackCertificationRequestInfo */
size_t pgpasn_UnpackCertificationRequestInfo(
PGPASN_CONTEXT *ctx,
PGPASN_CertificationRequestInfo **asnstruct,
const unsigned char *buf,
size_t buflen,
int *erret)
{
size_t bytesused;
bytesused=pgpasn_UnpackCertificationRequestInfoInternal(ctx, asnstruct, buf, buflen,
PGPASN_ID_CertificationRequestInfo, erret);
if(*erret==0 && bytesused==0)
PGPASN_ERR(kPGPASNError_ErrUnpackUnderrun);
return bytesused;
}
/******************************************************************
* Routines for GeneralName
******************************************************************/
PGPASN_GeneralName *pgpasn_NewGeneralName(
PGPASN_CONTEXT *ctx)
{
PGPASN_GeneralName *f;
if (ctx == NULL)
return NULL;
f = (PGPASN_GeneralName *)PGPASN_Alloc(ctx->memMgr, sizeof(PGPASN_GeneralName));
if (f != NULL)
(void)memset(f, 0, sizeof(PGPASN_GeneralName));
return (f);
} /* pgpasn_NewGeneralName */
void pgpasn_FreeGeneralName(
PGPASN_CONTEXT *ctx,
PGPASN_GeneralName *f)
{
if (ctx == NULL)
return;
pgpasn_DropInPlaceGeneralName(ctx, f);
if (f != NULL)
PGPASN_Free(ctx->memMgr, f);
} /* pgpasn_FreeGeneralName */
size_t pgpasn_SizeofGeneralName(
PGPASN_CONTEXT *ctx,
PGPASN_GeneralName *asnstruct,
int outerSizeFlag)
{
(void)ctx; /* for future use */
return(pgpasn_SizeofGeneralNameInternal(asnstruct, outerSizeFlag, PGPASN_FALSE));
} /* pgpasn_SizeofGeneralName */
size_t pgpasn_PackGeneralName(
PGPASN_CONTEXT *ctx,
unsigned char *buf,
size_t buflen,
PGPASN_GeneralName *asnstruct,
int *erret )
{
return(pgpasn_PackGeneralNameInt
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -