RetroZilla/security/nss/lib/crmf/cmmfi.h

99 lines
3.0 KiB
C
Raw Normal View History

2015-10-21 05:03:22 +02:00
/* -*- Mode: C; tab-width: 8 -*-*/
2018-05-04 16:08:28 +02:00
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
2015-10-21 05:03:22 +02:00
/*
* These are the definitions needed by the library internally to implement
* CMMF. Most of these will be helper utilities for manipulating internal
* data strucures.
*/
#ifndef _CMMFI_H_
#define _CMMFI_H_
#include "cmmfit.h"
#include "crmfi.h"
#define CMMF_MAX_CHALLENGES 10
#define CMMF_MAX_KEY_PAIRS 50
/*
* Some templates that the code will need to implement CMMF.
*/
extern const SEC_ASN1Template CMMFCertOrEncCertCertificateTemplate[];
extern const SEC_ASN1Template CMMFCertOrEncCertEncryptedCertTemplate[];
extern const SEC_ASN1Template CMMFPOPODecKeyRespContentTemplate[];
extern const SEC_ASN1Template CMMFRandTemplate[];
extern const SEC_ASN1Template CMMFSequenceOfCertsTemplate[];
extern const SEC_ASN1Template CMMFPKIStatusInfoTemplate[];
extern const SEC_ASN1Template CMMFCertifiedKeyPairTemplate[];
/*
* Some utility functions that are shared by multiple files in this
* implementation.
*/
2018-05-04 16:08:28 +02:00
extern SECStatus cmmf_CopyCertResponse (PLArenaPool *poolp,
2015-10-21 05:03:22 +02:00
CMMFCertResponse *dest,
CMMFCertResponse *src);
2018-05-04 16:08:28 +02:00
extern SECStatus cmmf_CopyPKIStatusInfo (PLArenaPool *poolp,
2015-10-21 05:03:22 +02:00
CMMFPKIStatusInfo *dest,
CMMFPKIStatusInfo *src);
2018-05-04 16:08:28 +02:00
extern SECStatus cmmf_CopyCertifiedKeyPair(PLArenaPool *poolp,
2015-10-21 05:03:22 +02:00
CMMFCertifiedKeyPair *dest,
CMMFCertifiedKeyPair *src);
extern SECStatus cmmf_DestroyPKIStatusInfo(CMMFPKIStatusInfo *info,
PRBool freeit);
extern SECStatus cmmf_DestroyCertOrEncCert(CMMFCertOrEncCert *certOrEncCert,
PRBool freeit);
extern SECStatus cmmf_PKIStatusInfoSetStatus(CMMFPKIStatusInfo *statusInfo,
2018-05-04 16:08:28 +02:00
PLArenaPool *poolp,
2015-10-21 05:03:22 +02:00
CMMFPKIStatus inStatus);
extern SECStatus cmmf_ExtractCertsFromList(CERTCertList *inCertList,
2018-05-04 16:08:28 +02:00
PLArenaPool *poolp,
2015-10-21 05:03:22 +02:00
CERTCertificate ***certArray);
extern SECStatus
cmmf_CertOrEncCertSetCertificate(CMMFCertOrEncCert *certOrEncCert,
2018-05-04 16:08:28 +02:00
PLArenaPool *poolp,
2015-10-21 05:03:22 +02:00
CERTCertificate *inCert);
extern CMMFPKIStatus
cmmf_PKIStatusInfoGetStatus(CMMFPKIStatusInfo *inStatus);
extern CERTCertList*
cmmf_MakeCertList(CERTCertificate **inCerts);
extern CERTCertificate*
cmmf_CertOrEncCertGetCertificate(CMMFCertOrEncCert *certOrEncCert,
CERTCertDBHandle *certdb);
extern SECStatus
2018-05-04 16:08:28 +02:00
cmmf_decode_process_cert_response(PLArenaPool *poolp,
2015-10-21 05:03:22 +02:00
CERTCertDBHandle *db,
CMMFCertResponse *inCertResp);
extern SECStatus
2018-05-04 16:08:28 +02:00
cmmf_decode_process_certified_key_pair(PLArenaPool *poolp,
2015-10-21 05:03:22 +02:00
CERTCertDBHandle *db,
CMMFCertifiedKeyPair *inCertKeyPair);
extern SECStatus
cmmf_user_encode(void *src, CRMFEncoderOutputCallback inCallback, void *inArg,
const SEC_ASN1Template *inTemplate);
extern SECStatus
2018-05-04 16:08:28 +02:00
cmmf_copy_secitem (PLArenaPool *poolp, SECItem *dest, SECItem *src);
2015-10-21 05:03:22 +02:00
#endif /*_CMMFI_H_*/