michael@0: /* -*- Mode: C; tab-width: 8 -*-*/ 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: /* michael@0: * These are the definitions needed by the library internally to implement michael@0: * CMMF. Most of these will be helper utilities for manipulating internal michael@0: * data strucures. michael@0: */ michael@0: #ifndef _CMMFI_H_ michael@0: #define _CMMFI_H_ michael@0: #include "cmmfit.h" michael@0: #include "crmfi.h" michael@0: michael@0: #define CMMF_MAX_CHALLENGES 10 michael@0: #define CMMF_MAX_KEY_PAIRS 50 michael@0: michael@0: /* michael@0: * Some templates that the code will need to implement CMMF. michael@0: */ michael@0: extern const SEC_ASN1Template CMMFCertOrEncCertCertificateTemplate[]; michael@0: extern const SEC_ASN1Template CMMFCertOrEncCertEncryptedCertTemplate[]; michael@0: extern const SEC_ASN1Template CMMFPOPODecKeyRespContentTemplate[]; michael@0: extern const SEC_ASN1Template CMMFRandTemplate[]; michael@0: extern const SEC_ASN1Template CMMFSequenceOfCertsTemplate[]; michael@0: extern const SEC_ASN1Template CMMFPKIStatusInfoTemplate[]; michael@0: extern const SEC_ASN1Template CMMFCertifiedKeyPairTemplate[]; michael@0: michael@0: michael@0: /* michael@0: * Some utility functions that are shared by multiple files in this michael@0: * implementation. michael@0: */ michael@0: michael@0: extern SECStatus cmmf_CopyCertResponse (PLArenaPool *poolp, michael@0: CMMFCertResponse *dest, michael@0: CMMFCertResponse *src); michael@0: michael@0: extern SECStatus cmmf_CopyPKIStatusInfo (PLArenaPool *poolp, michael@0: CMMFPKIStatusInfo *dest, michael@0: CMMFPKIStatusInfo *src); michael@0: michael@0: extern SECStatus cmmf_CopyCertifiedKeyPair(PLArenaPool *poolp, michael@0: CMMFCertifiedKeyPair *dest, michael@0: CMMFCertifiedKeyPair *src); michael@0: michael@0: extern SECStatus cmmf_DestroyPKIStatusInfo(CMMFPKIStatusInfo *info, michael@0: PRBool freeit); michael@0: michael@0: extern SECStatus cmmf_DestroyCertOrEncCert(CMMFCertOrEncCert *certOrEncCert, michael@0: PRBool freeit); michael@0: michael@0: extern SECStatus cmmf_PKIStatusInfoSetStatus(CMMFPKIStatusInfo *statusInfo, michael@0: PLArenaPool *poolp, michael@0: CMMFPKIStatus inStatus); michael@0: michael@0: extern SECStatus cmmf_ExtractCertsFromList(CERTCertList *inCertList, michael@0: PLArenaPool *poolp, michael@0: CERTCertificate ***certArray); michael@0: michael@0: extern SECStatus michael@0: cmmf_CertOrEncCertSetCertificate(CMMFCertOrEncCert *certOrEncCert, michael@0: PLArenaPool *poolp, michael@0: CERTCertificate *inCert); michael@0: michael@0: extern CMMFPKIStatus michael@0: cmmf_PKIStatusInfoGetStatus(CMMFPKIStatusInfo *inStatus); michael@0: michael@0: extern CERTCertList* michael@0: cmmf_MakeCertList(CERTCertificate **inCerts); michael@0: michael@0: extern CERTCertificate* michael@0: cmmf_CertOrEncCertGetCertificate(CMMFCertOrEncCert *certOrEncCert, michael@0: CERTCertDBHandle *certdb); michael@0: michael@0: extern SECStatus michael@0: cmmf_decode_process_cert_response(PLArenaPool *poolp, michael@0: CERTCertDBHandle *db, michael@0: CMMFCertResponse *inCertResp); michael@0: michael@0: extern SECStatus michael@0: cmmf_decode_process_certified_key_pair(PLArenaPool *poolp, michael@0: CERTCertDBHandle *db, michael@0: CMMFCertifiedKeyPair *inCertKeyPair); michael@0: michael@0: extern SECStatus michael@0: cmmf_user_encode(void *src, CRMFEncoderOutputCallback inCallback, void *inArg, michael@0: const SEC_ASN1Template *inTemplate); michael@0: michael@0: extern SECStatus michael@0: cmmf_copy_secitem (PLArenaPool *poolp, SECItem *dest, SECItem *src); michael@0: #endif /*_CMMFI_H_*/ michael@0: michael@0: michael@0: michael@0: michael@0: