michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: /* michael@0: * pkix_revocationmethod.c michael@0: * michael@0: * RevocationMethod Object Functions michael@0: * michael@0: */ michael@0: michael@0: #include "pkix_revocationmethod.h" michael@0: #include "pkix_tools.h" michael@0: michael@0: /* Constructor of revocation method object. Does not create an object, michael@0: * but just initializez PKIX_RevocationMethodStruct fields. Object michael@0: * suppose to be already created. */ michael@0: PKIX_Error * michael@0: pkix_RevocationMethod_Init( michael@0: pkix_RevocationMethod *method, michael@0: PKIX_RevocationMethodType methodType, michael@0: PKIX_UInt32 flags, michael@0: PKIX_UInt32 priority, michael@0: pkix_LocalRevocationCheckFn localRevChecker, michael@0: pkix_ExternalRevocationCheckFn externalRevChecker, michael@0: void *plContext) michael@0: { michael@0: PKIX_ENTER(REVOCATIONMETHOD, "PKIX_RevocationMethod_Init"); michael@0: michael@0: method->methodType = methodType; michael@0: method->flags = flags; michael@0: method->priority = priority; michael@0: method->localRevChecker = localRevChecker; michael@0: method->externalRevChecker = externalRevChecker; michael@0: michael@0: PKIX_RETURN(REVOCATIONMETHOD); michael@0: } michael@0: michael@0: /* Data duplication data. Not create an object. Only initializes fields michael@0: * in the new object by data from "object". */ michael@0: PKIX_Error * michael@0: pkix_RevocationMethod_Duplicate( michael@0: PKIX_PL_Object *object, michael@0: PKIX_PL_Object *newObject, michael@0: void *plContext) michael@0: { michael@0: pkix_RevocationMethod *method = NULL; michael@0: michael@0: PKIX_ENTER(REVOCATIONMETHOD, "pkix_RevocationMethod_Duplicate"); michael@0: PKIX_NULLCHECK_TWO(object, newObject); michael@0: michael@0: method = (pkix_RevocationMethod *)object; michael@0: michael@0: PKIX_CHECK( michael@0: pkix_RevocationMethod_Init((pkix_RevocationMethod*)newObject, michael@0: method->methodType, michael@0: method->flags, michael@0: method->priority, michael@0: method->localRevChecker, michael@0: method->externalRevChecker, michael@0: plContext), michael@0: PKIX_COULDNOTCREATEREVOCATIONMETHODOBJECT); michael@0: michael@0: cleanup: michael@0: michael@0: PKIX_RETURN(REVOCATIONMETHOD); michael@0: }