diff options
Diffstat (limited to 'nss/lib/crmf/crmffut.h')
-rw-r--r-- | nss/lib/crmf/crmffut.h | 172 |
1 files changed, 84 insertions, 88 deletions
diff --git a/nss/lib/crmf/crmffut.h b/nss/lib/crmf/crmffut.h index bde8241..d6f9374 100644 --- a/nss/lib/crmf/crmffut.h +++ b/nss/lib/crmf/crmffut.h @@ -8,112 +8,111 @@ */ /* - * Use this function to create the CRMFSinglePubInfo* variables that will + * Use this function to create the CRMFSinglePubInfo* variables that will * populate the inPubInfoArray parameter for the function * CRMF_CreatePKIPublicationInfo. * * "inPubMethod" specifies which publication method will be used - * "pubLocation" is a representation of the location where + * "pubLocation" is a representation of the location where */ -extern CRMFSinglePubInfo* - CRMF_CreateSinglePubInfo(CRMFPublicationMethod inPubMethod, - CRMFGeneralName *pubLocation); +extern CRMFSinglePubInfo * +CRMF_CreateSinglePubInfo(CRMFPublicationMethod inPubMethod, + CRMFGeneralName *pubLocation); /* * Create a PKIPublicationInfo that can later be passed to the function * CRMFAddPubInfoControl. */ extern CRMFPKIPublicationInfo * - CRMF_CreatePKIPublicationInfo(CRMFPublicationAction inAction, - CRMFSinglePubInfo **inPubInfoArray, - int numPubInfo); +CRMF_CreatePKIPublicationInfo(CRMFPublicationAction inAction, + CRMFSinglePubInfo **inPubInfoArray, + int numPubInfo); /* * Only call this function on a CRMFPublicationInfo that was created by * CRMF_CreatePKIPublicationInfo that was passed in NULL for arena. */ -extern SECStatus - CRMF_DestroyPKIPublicationInfo(CRMFPKIPublicationInfo *inPubInfo); +extern SECStatus +CRMF_DestroyPKIPublicationInfo(CRMFPKIPublicationInfo *inPubInfo); -extern SECStatus CRMF_AddPubInfoControl(CRMFCertRequest *inCertReq, - CRMFPKIPublicationInfo *inPubInfo); +extern SECStatus CRMF_AddPubInfoControl(CRMFCertRequest *inCertReq, + CRMFPKIPublicationInfo *inPubInfo); /* - * This is to create a Cert ID Control which can later be added to + * This is to create a Cert ID Control which can later be added to * a certificate request. */ -extern CRMFCertID* CRMF_CreateCertID(CRMFGeneralName *issuer, - long serialNumber); +extern CRMFCertID *CRMF_CreateCertID(CRMFGeneralName *issuer, + long serialNumber); -extern SECStatus CRMF_DestroyCertID(CRMFCertID* certID); +extern SECStatus CRMF_DestroyCertID(CRMFCertID *certID); extern SECStatus CRMF_AddCertIDControl(CRMFCertRequest *inCertReq, - CRMFCertID *certID); + CRMFCertID *certID); -extern SECStatus - CRMF_AddProtocolEncryptioKeyControl(CRMFCertRequest *inCertReq, - CERTSubjectPublicKeyInfo *spki); +extern SECStatus +CRMF_AddProtocolEncryptioKeyControl(CRMFCertRequest *inCertReq, + CERTSubjectPublicKeyInfo *spki); /* * Add the ASCII Pairs Registration Info to the Certificate Request. * The SECItem must be an OCTET string representation. */ extern SECStatus - CRMF_AddUTF8PairsRegInfo(CRMFCertRequest *inCertReq, - SECItem *asciiPairs); +CRMF_AddUTF8PairsRegInfo(CRMFCertRequest *inCertReq, + SECItem *asciiPairs); /* - * This takes a CertRequest and adds it to another CertRequest. + * This takes a CertRequest and adds it to another CertRequest. */ extern SECStatus - CRMF_AddCertReqToRegInfo(CRMFCertRequest *certReqToAddTo, - CRMFCertRequest *certReqBeingAdded); +CRMF_AddCertReqToRegInfo(CRMFCertRequest *certReqToAddTo, + CRMFCertRequest *certReqBeingAdded); /* * Returns which option was used for the authInfo field of POPOSigningKeyInput */ -extern CRMFPOPOSkiInputAuthChoice - CRMF_GetSignKeyInputAuthChoice(CRMFPOPOSigningKeyInput *inKeyInput); +extern CRMFPOPOSkiInputAuthChoice +CRMF_GetSignKeyInputAuthChoice(CRMFPOPOSigningKeyInput *inKeyInput); /* * Gets the PKMACValue associated with the POPOSigningKeyInput. - * If the POPOSigningKeyInput did not use authInfo.publicKeyMAC + * If the POPOSigningKeyInput did not use authInfo.publicKeyMAC * the function returns SECFailure and the value at *destValue is unchanged. * * If the POPOSigningKeyInput did use authInfo.publicKeyMAC, the function * returns SECSuccess and places the PKMACValue at *destValue. */ -extern SECStatus - CRMF_GetSignKeyInputPKMACValue(CRMFPOPOSigningKeyInput *inKeyInput, - CRMFPKMACValue **destValue); +extern SECStatus +CRMF_GetSignKeyInputPKMACValue(CRMFPOPOSigningKeyInput *inKeyInput, + CRMFPKMACValue **destValue); /* * Gets the SubjectPublicKeyInfo from the POPOSigningKeyInput */ extern CERTSubjectPublicKeyInfo * - CRMF_GetSignKeyInputPublicKey(CRMFPOPOSigningKeyInput *inKeyInput); - +CRMF_GetSignKeyInputPublicKey(CRMFPOPOSigningKeyInput *inKeyInput); /* * Return the value for the PKIPublicationInfo Control. - * A return value of NULL indicates that the Control was - * not a PKIPublicationInfo Control. Call + * A return value of NULL indicates that the Control was + * not a PKIPublicationInfo Control. Call * CRMF_DestroyPKIPublicationInfo on the return value when done * using the pointer. */ -extern CRMFPKIPublicationInfo* CRMF_GetPKIPubInfo(CRMFControl *inControl); +extern CRMFPKIPublicationInfo *CRMF_GetPKIPubInfo(CRMFControl *inControl); /* * Free up a CRMFPKIPublicationInfo structure. */ -extern SECStatus - CRMF_DestroyPKIPublicationInfo(CRMFPKIPublicationInfo *inPubInfo); +extern SECStatus +CRMF_DestroyPKIPublicationInfo(CRMFPKIPublicationInfo *inPubInfo); /* * Get the choice used for action in this PKIPublicationInfo. */ -extern CRMFPublicationAction - CRMF_GetPublicationAction(CRMFPKIPublicationInfo *inPubInfo); +extern CRMFPublicationAction +CRMF_GetPublicationAction(CRMFPKIPublicationInfo *inPubInfo); /* * Get the number of pubInfos are stored in the PKIPubicationInfo. @@ -124,9 +123,9 @@ extern int CRMF_GetNumPubInfos(CRMFPKIPublicationInfo *inPubInfo); * Get the pubInfo at index for the given PKIPubicationInfo. * Indexing is done like a traditional C Array. (0 .. numElements-1) */ -extern CRMFSinglePubInfo* - CRMF_GetPubInfoAtIndex(CRMFPKIPublicationInfo *inPubInfo, - int index); +extern CRMFSinglePubInfo * +CRMF_GetPubInfoAtIndex(CRMFPKIPublicationInfo *inPubInfo, + int index); /* * Destroy the CRMFSinglePubInfo. @@ -136,15 +135,15 @@ extern SECStatus CRMF_DestroySinglePubInfo(CRMFSinglePubInfo *inPubInfo); /* * Get the pubMethod used by the SinglePubInfo. */ -extern CRMFPublicationMethod - CRMF_GetPublicationMethod(CRMFSinglePubInfo *inPubInfo); +extern CRMFPublicationMethod +CRMF_GetPublicationMethod(CRMFSinglePubInfo *inPubInfo); /* * Get the pubLocation associated with the SinglePubInfo. * A NULL return value indicates there was no pubLocation associated * with the SinglePuInfo. */ -extern CRMFGeneralName* CRMF_GetPubLocation(CRMFSinglePubInfo *inPubInfo); +extern CRMFGeneralName *CRMF_GetPubLocation(CRMFSinglePubInfo *inPubInfo); /* * Get the authInfo.sender field out of the POPOSigningKeyInput. @@ -155,7 +154,7 @@ extern CRMFGeneralName* CRMF_GetPubLocation(CRMFSinglePubInfo *inPubInfo); * SECSuccess and puts the authInfo.sender at *destName/ */ extern SECStatus CRMF_GetSignKeyInputSender(CRMFPOPOSigningKeyInput *keyInput, - CRMFGeneralName **destName); + CRMFGeneralName **destName); /**************** CMMF Functions that need to be added. **********************/ @@ -175,7 +174,7 @@ extern SECStatus CRMF_GetSignKeyInputSender(CRMFPOPOSigningKeyInput *keyInput, * contained by 'inDecKeyChall'. Refer to the CMMF draft on how the * the random number passed in and the sender's GeneralName are used * to generate the challenge and witness fields of the challenge. This - * library will use SHA1 as the one-way function for generating the + * library will use SHA1 as the one-way function for generating the * witess field of the challenge. * * RETURN: @@ -184,11 +183,10 @@ extern SECStatus CRMF_GetSignKeyInputSender(CRMFPOPOSigningKeyInput *keyInput, * while trying to generate the challenge. */ extern SECStatus -CMMF_POPODecKeyChallContentSetNextChallenge - (CMMFPOPODecKeyChallContent *inDecKeyChall, - long inRandom, - CERTGeneralName *inSender, - SECKEYPublicKey *inPubKey); +CMMF_POPODecKeyChallContentSetNextChallenge(CMMFPOPODecKeyChallContent *inDecKeyChall, + long inRandom, + CERTGeneralName *inSender, + SECKEYPublicKey *inPubKey); /* * FUNCTION: CMMF_POPODecKeyChallContentGetNumChallenges @@ -196,11 +194,10 @@ CMMF_POPODecKeyChallContentSetNextChallenge * inKeyChallCont * The CMMFPOPODecKeyChallContent to operate on. * RETURN: - * This function returns the number of CMMFChallenges are contained in + * This function returns the number of CMMFChallenges are contained in * the CMMFPOPODecKeyChallContent structure. */ -extern int CMMF_POPODecKeyChallContentGetNumChallenges - (CMMFPOPODecKeyChallContent *inKeyChallCont); +extern int CMMF_POPODecKeyChallContentGetNumChallenges(CMMFPOPODecKeyChallContent *inKeyChallCont); /* * FUNCTION: CMMF_ChallengeGetRandomNumber @@ -213,9 +210,9 @@ extern int CMMF_POPODecKeyChallContentGetNumChallenges * challenge. * NOTES: * This function returns the value held in the decrypted Rand structure - * corresponding to the random integer. The user must call - * CMMF_ChallengeDecryptWitness before calling this function. Call - * CMMF_ChallengeIsDecrypted to find out if the challenge has been + * corresponding to the random integer. The user must call + * CMMF_ChallengeDecryptWitness before calling this function. Call + * CMMF_ChallengeIsDecrypted to find out if the challenge has been * decrypted. * * RETURN: @@ -225,7 +222,7 @@ extern int CMMF_POPODecKeyChallContentGetNumChallenges * is not a valid value. */ extern SECStatus CMMF_ChallengeGetRandomNumber(CMMFChallenge *inChallenge, - long *inDest); + long *inDest); /* * FUNCTION: CMMF_ChallengeGetSender @@ -234,8 +231,8 @@ extern SECStatus CMMF_ChallengeGetRandomNumber(CMMFChallenge *inChallenge, * the CMMFChallenge to operate on. * NOTES: * This function returns the value held in the decrypted Rand structure - * corresponding to the sender. The user must call - * CMMF_ChallengeDecryptWitness before calling this function. Call + * corresponding to the sender. The user must call + * CMMF_ChallengeDecryptWitness before calling this function. Call * CMMF_ChallengeIsDecrypted to find out if the witness field has been * decrypted. The user must call CERT_DestroyGeneralName after the return * value is no longer needed. @@ -245,7 +242,7 @@ extern SECStatus CMMF_ChallengeGetRandomNumber(CMMFChallenge *inChallenge, * NULL indicates an error in trying to copy the information or that the * witness field has not been decrypted. */ -extern CERTGeneralName* CMMF_ChallengeGetSender(CMMFChallenge *inChallenge); +extern CERTGeneralName *CMMF_ChallengeGetSender(CMMFChallenge *inChallenge); /* * FUNCTION: CMMF_ChallengeGetAlgId @@ -256,19 +253,19 @@ extern CERTGeneralName* CMMF_ChallengeGetSender(CMMFChallenge *inChallenge); * A pointer to memory where a pointer to a copy of the algorithm * id can be placed. * NOTES: - * This function retrieves the one way function algorithm identifier + * This function retrieves the one way function algorithm identifier * contained within the CMMFChallenge if the optional field is present. * * RETURN: * SECSucces indicates the function was able to place a pointer to a copy of - * the alogrithm id at *inAlgId. If the value at *inDestAlgId is NULL, - * that means there was no algorithm identifier present in the - * CMMFChallenge. Any other return value indicates the function was not - * able to make a copy of the algorithm identifier. In this case the value + * the alogrithm id at *inAlgId. If the value at *inDestAlgId is NULL, + * that means there was no algorithm identifier present in the + * CMMFChallenge. Any other return value indicates the function was not + * able to make a copy of the algorithm identifier. In this case the value * at *inDestAlgId is not valid. */ -extern SECStatus CMMF_ChallengeGetAlgId(CMMFChallenge *inChallenge, - SECAlgorithmID *inAlgId); +extern SECStatus CMMF_ChallengeGetAlgId(CMMFChallenge *inChallenge, + SECAlgorithmID *inAlgId); /* * FUNCTION: CMMF_DestroyChallenge @@ -276,14 +273,14 @@ extern SECStatus CMMF_ChallengeGetAlgId(CMMFChallenge *inChallenge, * inChallenge * The CMMFChallenge to free up. * NOTES: - * This function frees up all the memory associated with the CMMFChallenge + * This function frees up all the memory associated with the CMMFChallenge * passed in. * RETURN: * SECSuccess if freeing all the memory associated with the CMMFChallenge - * passed in is successful. Any other return value indicates an error + * passed in is successful. Any other return value indicates an error * while freeing the memory. */ -extern SECStatus CMMF_DestroyChallenge (CMMFChallenge *inChallenge); +extern SECStatus CMMF_DestroyChallenge(CMMFChallenge *inChallenge); /* * FUNCTION: CMMF_DestroyPOPODecKeyRespContent @@ -291,7 +288,7 @@ extern SECStatus CMMF_DestroyChallenge (CMMFChallenge *inChallenge); * inDecKeyResp * The CMMFPOPODecKeyRespContent structure to free. * NOTES: - * This function frees up all the memory associate with the + * This function frees up all the memory associate with the * CMMFPOPODecKeyRespContent. * * RETURN: @@ -300,7 +297,7 @@ extern SECStatus CMMF_DestroyChallenge (CMMFChallenge *inChallenge); * return value indicates an error while freeing the memory. */ extern SECStatus - CMMF_DestroyPOPODecKeyRespContent(CMMFPOPODecKeyRespContent *inDecKeyResp); +CMMF_DestroyPOPODecKeyRespContent(CMMFPOPODecKeyRespContent *inDecKeyResp); /* * FUNCTION: CMMF_ChallengeDecryptWitness @@ -312,7 +309,7 @@ extern SECStatus * NOTES: * This function uses the private key to decrypt the challenge field * contained in the CMMFChallenge. Make sure the private key matches the - * public key that was used to encrypt the witness. The creator of + * public key that was used to encrypt the witness. The creator of * the challenge will most likely be an RA that has the public key * from a Cert request. So the private key should be the private key * associated with public key in that request. This function will also @@ -320,15 +317,15 @@ extern SECStatus * * RETURN: * SECSuccess if decrypting the witness field was successful. This does - * not indicate that the decrypted data is valid, since the private key - * passed in may not be the actual key needed to properly decrypt the + * not indicate that the decrypted data is valid, since the private key + * passed in may not be the actual key needed to properly decrypt the * witness field. Meaning that there is a decrypted structure now, but * may be garbage because the private key was incorrect. * Any other return value indicates the function could not complete the * decryption process. */ -extern SECStatus CMMF_ChallengeDecryptWitness(CMMFChallenge *inChallenge, - SECKEYPrivateKey *inPrivKey); +extern SECStatus CMMF_ChallengeDecryptWitness(CMMFChallenge *inChallenge, + SECKEYPrivateKey *inPrivKey); /* * FUNCTION: CMMF_ChallengeIsDecrypted @@ -336,8 +333,8 @@ extern SECStatus CMMF_ChallengeDecryptWitness(CMMFChallenge *inChallenge, * inChallenge * The CMMFChallenge to operate on. * RETURN: - * This is a predicate function that returns PR_TRUE if the decryption - * process has already been performed. The function return PR_FALSE if + * This is a predicate function that returns PR_TRUE if the decryption + * process has already been performed. The function return PR_FALSE if * the decryption process has not been performed yet. */ extern PRBool CMMF_ChallengeIsDecrypted(CMMFChallenge *inChallenge); @@ -348,14 +345,13 @@ extern PRBool CMMF_ChallengeIsDecrypted(CMMFChallenge *inChallenge); * inDecKeyCont * The CMMFPOPODecKeyChallContent to free * NOTES: - * This function frees up all the memory associated with the - * CMMFPOPODecKeyChallContent + * This function frees up all the memory associated with the + * CMMFPOPODecKeyChallContent * RETURN: - * SECSuccess if freeing up all the memory associatd with the + * SECSuccess if freeing up all the memory associatd with the * CMMFPOPODecKeyChallContent is successful. Any other return value * indicates an error while freeing the memory. * */ -extern SECStatus - CMMF_DestroyPOPODecKeyChallContent (CMMFPOPODecKeyChallContent *inDecKeyCont); - +extern SECStatus +CMMF_DestroyPOPODecKeyChallContent(CMMFPOPODecKeyChallContent *inDecKeyCont); |