📄 icdistrict.h
字号:
/* Copyright 2003-2006, Voltage Security, all rights reserved.
*/
#include "vibe.h"
#include "environment.h"
#include "base.h"
#include "libctx.h"
#include "icparams.h"
#include "icserver.h"
#include "vcert.h"
#include "stringutil.h"
#ifndef _ICDISTRICT_H_
#define _ICDISTRICT_H_
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
int version;
icPublicParameters *pubParams;
VtPkcs7Object p7SignedData;
unsigned int certCount;
VtCertObject *certList;
Asn1X509Cert *asn1DomainCert;
} icDistrictParameters;
/* The paramsText looks like this.
* <pre>
* <code>
* -----BEGIN PKCS7-----
* <base64 encoded P7 SignedData>
* -----END PKCS7-----
* -----BEGIN CERTIFICATE-----
* <base64 encoded X.509 cert>
* -----END CERTIFICATE-----
* -----BEGIN CERTIFICATE-----
* <base64 encoded X.509 cert>
* -----END CERTIFICATE-----
* </code>
* </pre>
* <p>This function will base64 decode the contents and read them. It
* will expect to find the data in the P7 message to be the district
* parameters (prime, subprime, base point, pub point, district
* extensions, etc.). It will create VtCertObjects out of the X.509
* data.
* <p>The function will create an icDistrictParameters struct, fill it
* with the information, and return the newly created struct (it is the
* caller's responsibility to destroy it by calling
* icDistrictParametersFree when done with it).
* <p>Upon completion, the caller will find the district paramters, a
* VtPkcs7Object, and an array of cert objects in the returned struct.
* The function did not verify P7 message or the certs. To verify the
* P7 message, call VtPkcs7VerifyAll. However, that function will need
* a CertVerifyCtx and possibly a list of trusted certs.
*/
int icDistrictParametersNew(
icDistrictParameters **distParams,
char *paramsText,
unsigned int paramsTextLen,
VtMpIntCtx mpCtx,
VoltLibCtx *libCtx
);
/* Function destroys icDistrictParameters object.
*/
void icDistrictParametersFree (
icDistrictParameters *params,
VoltLibCtx *libCtx
);
int icRetrieveDistrictParameters (
icDistrictParameters **params,
char **paramsText,
unsigned char *domain,
unsigned char *district,
icHTTPfn httpFn,
void *httpFnAppData,
unsigned char *trustStore,
unsigned long timeOut,
VtMpIntCtx mpCtx,
VoltLibCtx *libCtx
);
/* Extract the domain name from a district name
* @param district full name.
* @param retl will be the actual name.
* @libCtx library context.
* @return 0 for success.
*/
int icGetDomainFromDistrict (
char *district,
char **retl,
VoltLibCtx *libCtx
);
#ifdef __cplusplus
}
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -