本文整理汇总了C++中PKIX_INCREF函数的典型用法代码示例。如果您正苦于以下问题:C++ PKIX_INCREF函数的具体用法?C++ PKIX_INCREF怎么用?C++ PKIX_INCREF使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PKIX_INCREF函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pkix_pl_CertPolicyQualifier_Create
/*
* FUNCTION: pkix_pl_CertPolicyQualifier_Create
* DESCRIPTION:
*
* Creates a CertPolicyQualifier object with the OID given by "oid"
* and the ByteArray given by "qualifier", and stores it at "pObject".
*
* PARAMETERS
* "oid"
* Address of OID of the desired policyQualifierId; must be non-NULL
* "qualifier"
* Address of ByteArray with the desired value of the qualifier;
* must be non-NULL
* "pObject"
* Address where object pointer will be stored. Must be non-NULL.
* "plContext"
* Platform-specific context pointer.
* THREAD SAFETY:
* Thread Safe (see Thread Safety Definitions in Programmer's Guide)
* RETURNS:
* Returns NULL if the function succeeds.
* Returns a Fatal Error if the function fails in an unrecoverable way.
*/
PKIX_Error *
pkix_pl_CertPolicyQualifier_Create(
PKIX_PL_OID *oid,
PKIX_PL_ByteArray *qualifier,
PKIX_PL_CertPolicyQualifier **pObject,
void *plContext)
{
PKIX_PL_CertPolicyQualifier *qual = NULL;
PKIX_ENTER(CERTPOLICYQUALIFIER, "pkix_pl_CertPolicyQualifier_Create");
PKIX_NULLCHECK_THREE(oid, qualifier, pObject);
PKIX_CHECK(PKIX_PL_Object_Alloc
(PKIX_CERTPOLICYQUALIFIER_TYPE,
sizeof (PKIX_PL_CertPolicyQualifier),
(PKIX_PL_Object **)&qual,
plContext),
PKIX_COULDNOTCREATECERTPOLICYQUALIFIEROBJECT);
PKIX_INCREF(oid);
qual->policyQualifierId = oid;
PKIX_INCREF(qualifier);
qual->qualifier = qualifier;
*pObject = qual;
qual = NULL;
cleanup:
PKIX_DECREF(qual);
PKIX_RETURN(CERTPOLICYQUALIFIER);
}
示例2: pkix_pl_CertPolicyMap_Create
/*
* FUNCTION: pkix_pl_CertPolicyMap_Create
* DESCRIPTION:
*
* Creates a new CertPolicyMap Object pairing the OID given by
* "issuerDomainPolicy" with the OID given by "subjectDomainPolicy", and
* stores the result at "pCertPolicyMap".
*
* PARAMETERS
* "issuerDomainPolicy"
* Address of the OID of the IssuerDomainPolicy. Must be non-NULL.
* "subjectDomainPolicy"
* Address of the OID of the SubjectDomainPolicy. Must be non-NULL.
* "pCertPolicyMap"
* Address where CertPolicyMap pointer will be stored. Must be non-NULL.
* "plContext"
* Platform-specific context pointer.
* THREAD SAFETY:
* Thread Safe (see Thread Safety Definitions in Programmer's Guide)
* RETURNS:
* Returns NULL if the function succeeds.
* Returns a CertPolicyMap Error if the function fails in a non-fatal way.
* Returns a Fatal Error if the function fails in an unrecoverable way.
*/
PKIX_Error *
pkix_pl_CertPolicyMap_Create(
PKIX_PL_OID *issuerDomainPolicy,
PKIX_PL_OID *subjectDomainPolicy,
PKIX_PL_CertPolicyMap **pCertPolicyMap,
void *plContext)
{
PKIX_PL_CertPolicyMap *policyMap = NULL;
PKIX_ENTER(CERTPOLICYMAP, "pkix_pl_CertPolicyMap_Create");
PKIX_NULLCHECK_THREE
(issuerDomainPolicy, subjectDomainPolicy, pCertPolicyMap);
PKIX_CHECK(PKIX_PL_Object_Alloc
(PKIX_CERTPOLICYMAP_TYPE,
sizeof (PKIX_PL_CertPolicyMap),
(PKIX_PL_Object **)&policyMap,
plContext),
PKIX_COULDNOTCREATECERTPOLICYMAPOBJECT);
PKIX_INCREF(issuerDomainPolicy);
policyMap->issuerDomainPolicy = issuerDomainPolicy;
PKIX_INCREF(subjectDomainPolicy);
policyMap->subjectDomainPolicy = subjectDomainPolicy;
*pCertPolicyMap = policyMap;
cleanup:
PKIX_RETURN(CERTPOLICYMAP);
}
示例3: PKIX_Error_Create
/*
* FUNCTION: PKIX_Error_Create (see comments in pkix_util.h)
*/
PKIX_Error *
PKIX_Error_Create(
PKIX_ERRORCLASS errClass,
PKIX_Error *cause,
PKIX_PL_Object *info,
PKIX_ERRORCODE errCode,
PKIX_Error **pError,
void *plContext)
{
PKIX_Error *tempCause = NULL;
PKIX_Error *error = NULL;
PKIX_ENTER(ERROR, "PKIX_Error_Create");
PKIX_NULLCHECK_ONE(pError);
/*
* when called here, if PKIX_PL_Object_Alloc returns an error,
* it must be a PKIX_ALLOC_ERROR
*/
pkixErrorResult = PKIX_PL_Object_Alloc
(PKIX_ERROR_TYPE,
((PKIX_UInt32)(sizeof (PKIX_Error))),
(PKIX_PL_Object **)&error,
plContext);
if (pkixErrorResult) return (pkixErrorResult);
error->errClass = errClass;
/* Ensure we don't have a loop. Follow causes until NULL */
for (tempCause = cause;
tempCause != NULL;
tempCause = tempCause->cause) {
/* If we detect a loop, throw a new error */
if (tempCause == error) {
PKIX_ERROR(PKIX_LOOPOFERRORCAUSEDETECTED);
}
}
PKIX_INCREF(cause);
error->cause = cause;
PKIX_INCREF(info);
error->info = info;
error->errCode = errCode;
error->plErr = PKIX_PLErrorIndex[error->errCode];
*pError = error;
error = NULL;
cleanup:
/* PKIX-XXX Fix for leak during error creation */
PKIX_DECREF(error);
PKIX_RETURN(ERROR);
}
示例4: PKIX_List_InsertItem
/*
* FUNCTION: PKIX_List_InsertItem (see comments in pkix_util.h)
*/
PKIX_Error *
PKIX_List_InsertItem(
PKIX_List *list,
PKIX_UInt32 index,
PKIX_PL_Object *item,
void *plContext)
{
PKIX_List *element = NULL;
PKIX_List *newElem = NULL;
PKIX_ENTER(LIST, "PKIX_List_InsertItem");
PKIX_NULLCHECK_ONE(list);
if (list->immutable){
PKIX_ERROR(PKIX_OPERATIONNOTPERMITTEDONIMMUTABLELIST);
}
if (!list->isHeader){
PKIX_ERROR(PKIX_INPUTLISTMUSTBEHEADER);
}
/* Create a new list object */
PKIX_CHECK(pkix_List_Create_Internal(PKIX_FALSE, &newElem, plContext),
PKIX_LISTCREATEINTERNALFAILED);
if (list->length) {
PKIX_CHECK(pkix_List_GetElement(list, index, &element, plContext),
PKIX_LISTGETELEMENTFAILED);
/* Copy the old element's contents into the new element */
newElem->item = element->item;
/* Add new item to the list */
PKIX_INCREF(item);
element->item = item;
/* Set the new element's next pointer to the old element's next */
newElem->next = element->next;
/* Set the old element's next pointer to the new element */
element->next = newElem;
newElem = NULL;
} else {
PKIX_INCREF(item);
newElem->item = item;
newElem->next = NULL;
list->next = newElem;
newElem = NULL;
}
list->length++;
PKIX_CHECK(PKIX_PL_Object_InvalidateCache
((PKIX_PL_Object *)list, plContext),
PKIX_OBJECTINVALIDATECACHEFAILED);
cleanup:
PKIX_DECREF(newElem);
PKIX_RETURN(LIST);
}
示例5: pkix_PolicyNode_Create
/*
* FUNCTION: pkix_PolicyNode_Create
* DESCRIPTION:
*
* Creates a new PolicyNode using the OID pointed to by "validPolicy", the List
* of CertPolicyQualifiers pointed to by "qualifierSet", the criticality
* indicated by the Boolean value of "criticality", and the List of OIDs
* pointed to by "expectedPolicySet", and stores the result at "pObject". The
* criticality should be derived from whether the certificate policy extension
* was marked as critical in the certificate that led to creation of this
* PolicyNode. The "qualifierSet" and "expectedPolicySet" Lists are made
* immutable. The PolicyNode pointers to parent and to children are initialized
* to NULL, and the depth is set to zero; those values should be set by using
* the pkix_PolicyNode_AddToParent function.
*
* PARAMETERS
* "validPolicy"
* Address of OID of the valid policy for the path. Must be non-NULL
* "qualifierSet"
* Address of List of CertPolicyQualifiers associated with the validpolicy.
* May be NULL
* "criticality"
* Boolean indicator of whether the criticality should be set in this
* PolicyNode
* "expectedPolicySet"
* Address of List of OIDs that would satisfy this policy in the next
* certificate. Must be non-NULL
* "pObject"
* Address where the PolicyNode pointer will be stored. Must be non-NULL.
* "plContext"
* Platform-specific context pointer.
* THREAD SAFETY:
* Thread Safe (see Thread Safety Definitions in Programmer's Guide)
* RETURNS:
* Returns NULL if the function succeeds.
* Returns a PolicyNode Error if the function fails in a non-fatal way.
* Returns a Fatal Error if the function fails in an unrecoverable way.
*/
PKIX_Error *
pkix_PolicyNode_Create(
PKIX_PL_OID *validPolicy,
PKIX_List *qualifierSet,
PKIX_Boolean criticality,
PKIX_List *expectedPolicySet,
PKIX_PolicyNode **pObject,
void *plContext)
{
PKIX_PolicyNode *node = NULL;
PKIX_ENTER(CERTPOLICYNODE, "pkix_PolicyNode_Create");
PKIX_NULLCHECK_THREE(validPolicy, expectedPolicySet, pObject);
PKIX_CHECK(PKIX_PL_Object_Alloc
(PKIX_CERTPOLICYNODE_TYPE,
sizeof (PKIX_PolicyNode),
(PKIX_PL_Object **)&node,
plContext),
PKIX_COULDNOTCREATEPOLICYNODEOBJECT);
PKIX_INCREF(validPolicy);
node->validPolicy = validPolicy;
PKIX_INCREF(qualifierSet);
node->qualifierSet = qualifierSet;
if (qualifierSet) {
PKIX_CHECK(PKIX_List_SetImmutable(qualifierSet, plContext),
PKIX_LISTSETIMMUTABLEFAILED);
}
node->criticality = criticality;
PKIX_INCREF(expectedPolicySet);
node->expectedPolicySet = expectedPolicySet;
PKIX_CHECK(PKIX_List_SetImmutable(expectedPolicySet, plContext),
PKIX_LISTSETIMMUTABLEFAILED);
node->parent = NULL;
node->children = NULL;
node->depth = 0;
*pObject = node;
node = NULL;
cleanup:
PKIX_DECREF(node);
PKIX_RETURN(CERTPOLICYNODE);
}
示例6: PKIX_TrustAnchor_CreateWithNameKeyPair
/*
* FUNCTION: PKIX_TrustAnchor_CreateWithNameKeyPair
* (see comments in pkix_params.h)
*/
PKIX_Error *
PKIX_TrustAnchor_CreateWithNameKeyPair(
PKIX_PL_X500Name *name,
PKIX_PL_PublicKey *pubKey,
PKIX_PL_CertNameConstraints *nameConstraints,
PKIX_TrustAnchor **pAnchor,
void *plContext)
{
PKIX_TrustAnchor *anchor = NULL;
PKIX_ENTER(TRUSTANCHOR, "PKIX_TrustAnchor_CreateWithNameKeyPair");
#ifndef BUILD_LIBPKIX_TESTS
/* Nss creates trust anchors by using PKIX_TrustAnchor_CreateWithCert
* function as the complete trusted cert structure, and not only cert
* public key, is required for chain building and validation processes.
* Restricting this function for been used only in libpkix unit
* tests. */
PKIX_ERROR(PKIX_FUNCTIONMUSTNOTBEUSED);
#endif
PKIX_NULLCHECK_THREE(name, pubKey, pAnchor);
PKIX_CHECK(PKIX_PL_Object_Alloc
(PKIX_TRUSTANCHOR_TYPE,
sizeof (PKIX_TrustAnchor),
(PKIX_PL_Object **)&anchor,
plContext),
PKIX_COULDNOTCREATETRUSTANCHOROBJECT);
/* initialize fields */
anchor->trustedCert = NULL;
PKIX_INCREF(name);
anchor->caName = name;
PKIX_INCREF(pubKey);
anchor->caPubKey = pubKey;
PKIX_INCREF(nameConstraints);
anchor->nameConstraints = nameConstraints;
*pAnchor = anchor;
anchor = NULL;
cleanup:
PKIX_DECREF(anchor);
PKIX_RETURN(TRUSTANCHOR);
}
示例7: pkix_pl_CollectionCertStoreContext_Create
/*
* FUNCTION: PKIX_PL_CollectionCertStoreContext_Create
* DESCRIPTION:
*
* Creates a new CollectionCertStoreContext using the String pointed to
* by "storeDir" and stores it at "pColCertStoreContext".
*
* PARAMETERS:
* "storeDir"
* The absolute path where *.crl and *.crt files are located.
* "pColCertStoreContext"
* Address where object pointer will be stored. Must be non-NULL.
* "plContext"
* Platform-specific context pointer.
* THREAD SAFETY:
* Thread Safe (see Thread Safety Definitions in Programmer's Guide)
* RETURNS:
* Returns NULL if the function succeeds.
* Returns a CollectionCertStoreContext Error if the function fails in
* a non-fatal way.
* Returns a Fatal Error if the function fails in an unrecoverable way.
*/
static PKIX_Error *
pkix_pl_CollectionCertStoreContext_Create(
PKIX_PL_String *storeDir,
PKIX_PL_CollectionCertStoreContext **pColCertStoreContext,
void *plContext)
{
PKIX_PL_CollectionCertStoreContext *colCertStoreContext = NULL;
PKIX_ENTER(COLLECTIONCERTSTORECONTEXT,
"pkix_pl_CollectionCertStoreContext_Create");
PKIX_NULLCHECK_TWO(storeDir, pColCertStoreContext);
PKIX_CHECK(PKIX_PL_Object_Alloc
(PKIX_COLLECTIONCERTSTORECONTEXT_TYPE,
sizeof (PKIX_PL_CollectionCertStoreContext),
(PKIX_PL_Object **)&colCertStoreContext,
plContext),
PKIX_COULDNOTCREATECOLLECTIONCERTSTORECONTEXTOBJECT);
PKIX_INCREF(storeDir);
colCertStoreContext->storeDir = storeDir;
colCertStoreContext->crlList = NULL;
colCertStoreContext->certList = NULL;
*pColCertStoreContext = colCertStoreContext;
colCertStoreContext = NULL;
cleanup:
PKIX_DECREF(colCertStoreContext);
PKIX_RETURN(COLLECTIONCERTSTORECONTEXT);
}
示例8: PKIX_ProcessingParams_SetRevocationCheckers
/*
* FUNCTION: PKIX_ProcessingParams_SetRevocationCheckers
* (see comments in pkix_params.h)
*/
PKIX_Error *
PKIX_ProcessingParams_SetRevocationCheckers(
PKIX_ProcessingParams *params,
PKIX_List *checkers, /* list of PKIX_RevocationChecker */
void *plContext)
{
PKIX_ENTER(PROCESSINGPARAMS,
"PKIX_ProcessingParams_SetRevocationCheckers");
PKIX_NULLCHECK_ONE(params);
PKIX_DECREF(params->revCheckers);
PKIX_INCREF(checkers);
params->revCheckers = checkers;
PKIX_CHECK(PKIX_PL_Object_InvalidateCache
((PKIX_PL_Object *)params, plContext),
PKIX_OBJECTINVALIDATECACHEFAILED);
cleanup:
if (PKIX_ERROR_RECEIVED && params) {
PKIX_DECREF(params->revCheckers);
}
PKIX_RETURN(PROCESSINGPARAMS);
}
示例9: PKIX_ProcessingParams_GetRevocationCheckers
/*
* FUNCTION: PKIX_ProcessingParams_GetRevocationCheckers
* (see comments in pkix_params.h)
*/
PKIX_Error *
PKIX_ProcessingParams_GetRevocationCheckers(
PKIX_ProcessingParams *params,
PKIX_List **pCheckers, /* list of PKIX_RevocationChecker */
void *plContext)
{
PKIX_ENTER
(PROCESSINGPARAMS, "PKIX_ProcessingParams_GetRevocationCheckers");
PKIX_NULLCHECK_TWO(params, pCheckers);
if (params->revCheckers == NULL) {
PKIX_CHECK(PKIX_List_Create
(&(params->revCheckers), plContext),
PKIX_LISTCREATEFAILED);
}
PKIX_INCREF(params->revCheckers);
*pCheckers = params->revCheckers;
cleanup:
PKIX_RETURN(PROCESSINGPARAMS);
}
示例10: PKIX_ProcessingParams_SetInitialPolicies
/*
* FUNCTION: PKIX_ProcessingParams_SetInitialPolicies
* (see comments in pkix_params.h)
*/
PKIX_Error *
PKIX_ProcessingParams_SetInitialPolicies(
PKIX_ProcessingParams *params,
PKIX_List *initPolicies, /* list of PKIX_PL_OID */
void *plContext)
{
PKIX_ENTER(PROCESSINGPARAMS,
"PKIX_ProcessingParams_SetInitialPolicies");
PKIX_NULLCHECK_ONE(params);
PKIX_DECREF(params->initialPolicies);
PKIX_INCREF(initPolicies);
params->initialPolicies = initPolicies;
PKIX_CHECK(PKIX_PL_Object_InvalidateCache
((PKIX_PL_Object *)params, plContext),
PKIX_OBJECTINVALIDATECACHEFAILED);
cleanup:
if (PKIX_ERROR_RECEIVED && params) {
PKIX_DECREF(params->initialPolicies);
}
PKIX_RETURN(PROCESSINGPARAMS);
}
示例11: PKIX_ProcessingParams_GetInitialPolicies
/*
* FUNCTION: PKIX_ProcessingParams_GetInitialPolicies
* (see comments in pkix_params.h)
*/
PKIX_Error *
PKIX_ProcessingParams_GetInitialPolicies(
PKIX_ProcessingParams *params,
PKIX_List **pInitPolicies, /* list of PKIX_PL_OID */
void *plContext)
{
PKIX_ENTER(PROCESSINGPARAMS,
"PKIX_ProcessingParams_GetInitialPolicies");
PKIX_NULLCHECK_TWO(params, pInitPolicies);
if (params->initialPolicies == NULL) {
PKIX_CHECK(PKIX_List_Create
(¶ms->initialPolicies, plContext),
PKIX_UNABLETOCREATELIST);
PKIX_CHECK(PKIX_List_SetImmutable
(params->initialPolicies, plContext),
PKIX_UNABLETOMAKELISTIMMUTABLE);
PKIX_CHECK(PKIX_PL_Object_InvalidateCache
((PKIX_PL_Object *)params, plContext),
PKIX_OBJECTINVALIDATECACHEFAILED);
}
PKIX_INCREF(params->initialPolicies);
*pInitPolicies = params->initialPolicies;
cleanup:
PKIX_RETURN(PROCESSINGPARAMS);
}
示例12: PKIX_ProcessingParams_SetDate
/*
* FUNCTION: PKIX_ProcessingParams_SetDate (see comments in pkix_params.h)
*/
PKIX_Error *
PKIX_ProcessingParams_SetDate(
PKIX_ProcessingParams *params,
PKIX_PL_Date *date,
void *plContext)
{
PKIX_ENTER(PROCESSINGPARAMS, "PKIX_ProcessingParams_SetDate");
PKIX_NULLCHECK_ONE(params);
PKIX_DECREF(params->date);
PKIX_INCREF(date);
params->date = date;
PKIX_CHECK(PKIX_PL_Object_InvalidateCache
((PKIX_PL_Object *)params, plContext),
PKIX_OBJECTINVALIDATECACHEFAILED);
cleanup:
if (PKIX_ERROR_RECEIVED && params) {
PKIX_DECREF(params->date);
}
PKIX_RETURN(PROCESSINGPARAMS);
}
示例13: PKIX_Logger_Create
/*
* FUNCTION: PKIX_Logger_Create (see comments in pkix_util.h)
*/
PKIX_Error *
PKIX_Logger_Create(
PKIX_Logger_LogCallback callback,
PKIX_PL_Object *loggerContext,
PKIX_Logger **pLogger,
void *plContext)
{
PKIX_Logger *logger = NULL;
PKIX_ENTER(LOGGER, "PKIX_Logger_Create");
PKIX_NULLCHECK_ONE(pLogger);
PKIX_CHECK(PKIX_PL_Object_Alloc
(PKIX_LOGGER_TYPE,
sizeof (PKIX_Logger),
(PKIX_PL_Object **)&logger,
plContext),
PKIX_COULDNOTCREATELOGGEROBJECT);
logger->callback = callback;
logger->maxLevel = 0;
logger->logComponent = (PKIX_ERRORCLASS)NULL;
PKIX_INCREF(loggerContext);
logger->context = loggerContext;
*pLogger = logger;
logger = NULL;
cleanup:
PKIX_DECREF(logger);
PKIX_RETURN(LOGGER);
}
示例14: PKIX_RevocationChecker_Create
/*
* FUNCTION: PKIX_RevocationChecker_Create (see comments in pkix_checker.h)
*/
PKIX_Error *
PKIX_RevocationChecker_Create(
PKIX_RevocationChecker_RevCallback callback,
PKIX_PL_Object *revCheckerContext,
PKIX_RevocationChecker **pChecker,
void *plContext)
{
PKIX_RevocationChecker *checker = NULL;
PKIX_ENTER(REVOCATIONCHECKER, "PKIX_RevocationChecker_Create");
PKIX_NULLCHECK_ONE(pChecker);
PKIX_CHECK(PKIX_PL_Object_Alloc
(PKIX_REVOCATIONCHECKER_TYPE,
sizeof (PKIX_RevocationChecker),
(PKIX_PL_Object **)&checker,
plContext),
PKIX_COULDNOTCREATECERTCHAINCHECKEROBJECT);
/* initialize fields */
checker->checkCallback = callback;
PKIX_INCREF(revCheckerContext);
checker->revCheckerContext = revCheckerContext;
*pChecker = checker;
cleanup:
PKIX_RETURN(REVOCATIONCHECKER);
}
示例15: PKIX_PolicyNode_GetPolicyQualifiers
/*
* FUNCTION: PKIX_PolicyNode_GetPolicyQualifiers
* (see description of this function in pkix_results.h)
*/
PKIX_Error *
PKIX_PolicyNode_GetPolicyQualifiers(
PKIX_PolicyNode *node,
PKIX_List **pQualifiers, /* list of PKIX_PL_CertPolicyQualifier */
void *plContext)
{
PKIX_List *qualifiers = NULL;
PKIX_ENTER(CERTPOLICYNODE, "PKIX_PolicyNode_GetPolicyQualifiers");
PKIX_NULLCHECK_TWO(node, pQualifiers);
PKIX_INCREF(node->qualifierSet);
qualifiers = node->qualifierSet;
if (!qualifiers) {
PKIX_CHECK(PKIX_List_Create(&qualifiers, plContext),
PKIX_LISTCREATEFAILED);
}
PKIX_CHECK(PKIX_List_SetImmutable(qualifiers, plContext),
PKIX_LISTSETIMMUTABLEFAILED);
*pQualifiers = qualifiers;
cleanup:
PKIX_RETURN(CERTPOLICYNODE);
}