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: /* Header file with all of the structures and types that will be exported michael@0: * by the security library for implementation of CRMF. michael@0: */ michael@0: michael@0: #ifndef _CRMFT_H_ michael@0: #define _CRMFT_H_ michael@0: michael@0: /* Use these enumerated values for adding fields to the certificate request */ michael@0: typedef enum { michael@0: crmfVersion = 0, michael@0: crmfSerialNumber = 1, michael@0: crmfSigningAlg = 2, michael@0: crmfIssuer = 3, michael@0: crmfValidity = 4, michael@0: crmfSubject = 5, michael@0: crmfPublicKey = 6, michael@0: crmfIssuerUID = 7, michael@0: crmfSubjectUID = 8, michael@0: crmfExtension = 9 michael@0: } CRMFCertTemplateField; michael@0: michael@0: /* michael@0: * An enumeration for the different types of controls. michael@0: */ michael@0: typedef enum { michael@0: crmfNoControl = 0, michael@0: crmfRegTokenControl = 1, michael@0: crmfAuthenticatorControl = 2, michael@0: crmfPKIPublicationInfoControl = 3, michael@0: crmfPKIArchiveOptionsControl = 4, michael@0: crmfOldCertIDControl = 5, michael@0: crmfProtocolEncrKeyControl = 6 michael@0: } CRMFControlType; michael@0: michael@0: /* michael@0: * The possible values that are passed into CRMF_CreatePKIPublicationInfo michael@0: */ michael@0: typedef enum { michael@0: crmfDontPublish = 0, michael@0: crmfPleasePublish = 1 michael@0: } CRMFPublicationAction; michael@0: michael@0: /* michael@0: * An enumeration for the possible for pubMethod which is a part of michael@0: * the SinglePubInfo ASN1 type. michael@0: */ michael@0: typedef enum { michael@0: crmfDontCare = 0, michael@0: crmfX500 = 1, michael@0: crmfWeb = 2, michael@0: crmfLdap = 3 michael@0: } CRMFPublicationMethod; michael@0: michael@0: /* michael@0: * An enumeration for the different options for PKIArchiveOptions type. michael@0: */ michael@0: typedef enum { michael@0: crmfNoArchiveOptions = 0, michael@0: crmfEncryptedPrivateKey = 1, michael@0: crmfKeyGenParameters = 2, michael@0: crmfArchiveRemGenPrivKey = 3 michael@0: } CRMFPKIArchiveOptionsType; michael@0: michael@0: /* michael@0: * An enumeration for the different options for ProofOfPossession michael@0: */ michael@0: typedef enum { michael@0: crmfNoPOPChoice = 0, michael@0: crmfRAVerified = 1, michael@0: crmfSignature = 2, michael@0: crmfKeyEncipherment = 3, michael@0: crmfKeyAgreement = 4 michael@0: } CRMFPOPChoice; michael@0: michael@0: /* michael@0: * An enumertion type for options for the authInfo field of the michael@0: * CRMFPOPOSigningKeyInput structure. michael@0: */ michael@0: typedef enum { michael@0: crmfSender = 0, michael@0: crmfPublicKeyMAC = 1 michael@0: } CRMFPOPOSkiInputAuthChoice; michael@0: michael@0: /* michael@0: * An enumeration for the SubsequentMessage Options. michael@0: */ michael@0: typedef enum { michael@0: crmfNoSubseqMess = 0, michael@0: crmfEncrCert = 1, michael@0: crmfChallengeResp = 2 michael@0: } CRMFSubseqMessOptions; michael@0: michael@0: /* michael@0: * An enumeration for the choice used by POPOPrivKey. michael@0: */ michael@0: typedef enum { michael@0: crmfNoMessage = 0, michael@0: crmfThisMessage = 1, michael@0: crmfSubsequentMessage = 2, michael@0: crmfDHMAC = 3 michael@0: } CRMFPOPOPrivKeyChoice; michael@0: michael@0: /* michael@0: * An enumeration for the choices for the EncryptedKey type. michael@0: */ michael@0: typedef enum { michael@0: crmfNoEncryptedKeyChoice = 0, michael@0: crmfEncryptedValueChoice = 1, michael@0: crmfEnvelopedDataChoice = 2 michael@0: } CRMFEncryptedKeyChoice; michael@0: michael@0: /* michael@0: * TYPE: CRMFEncoderOutputCallback michael@0: * This function type defines a prototype for a function that the CRMF michael@0: * library expects when encoding is performed. michael@0: * michael@0: * ARGUMENTS: michael@0: * arg michael@0: * This will be a pointer the user passed into an encoding function. michael@0: * The user of the library is free to use this pointer in any way. michael@0: * The most common use is to keep around a buffer for writing out michael@0: * the DER encoded bytes. michael@0: * buf michael@0: * The DER encoded bytes that should be written out. michael@0: * len michael@0: * The number of DER encoded bytes to write out. michael@0: * michael@0: */ michael@0: typedef void (*CRMFEncoderOutputCallback) (void *arg, michael@0: const char *buf, michael@0: unsigned long len); michael@0: michael@0: /* michael@0: * Type for the function that gets a password. Just in case we ever michael@0: * need to support publicKeyMAC for POPOSigningKeyInput michael@0: */ michael@0: typedef SECItem* (*CRMFMACPasswordCallback) (void *arg); michael@0: michael@0: typedef struct CRMFOptionalValidityStr CRMFOptionalValidity; michael@0: typedef struct CRMFValidityCreationInfoStr CRMFGetValidity; michael@0: typedef struct CRMFCertTemplateStr CRMFCertTemplate; michael@0: typedef struct CRMFCertRequestStr CRMFCertRequest; michael@0: typedef struct CRMFCertReqMsgStr CRMFCertReqMsg; michael@0: typedef struct CRMFCertReqMessagesStr CRMFCertReqMessages; michael@0: typedef struct CRMFProofOfPossessionStr CRMFProofOfPossession; michael@0: typedef struct CRMFPOPOSigningKeyStr CRMFPOPOSigningKey; michael@0: typedef struct CRMFPOPOSigningKeyInputStr CRMFPOPOSigningKeyInput; michael@0: typedef struct CRMFPOPOPrivKeyStr CRMFPOPOPrivKey; michael@0: typedef struct CRMFPKIPublicationInfoStr CRMFPKIPublicationInfo; michael@0: typedef struct CRMFSinglePubInfoStr CRMFSinglePubInfo; michael@0: typedef struct CRMFPKIArchiveOptionsStr CRMFPKIArchiveOptions; michael@0: typedef struct CRMFEncryptedKeyStr CRMFEncryptedKey; michael@0: typedef struct CRMFEncryptedValueStr CRMFEncryptedValue; michael@0: typedef struct CRMFCertIDStr CRMFCertID; michael@0: typedef struct CRMFCertIDStr CRMFOldCertID; michael@0: typedef CERTSubjectPublicKeyInfo CRMFProtocolEncrKey; michael@0: typedef struct CRMFValidityCreationInfoStr CRMFValidityCreationInfo; michael@0: typedef struct CRMFCertExtCreationInfoStr CRMFCertExtCreationInfo; michael@0: typedef struct CRMFPKMACValueStr CRMFPKMACValue; michael@0: typedef struct CRMFAttributeStr CRMFAttribute; michael@0: typedef struct CRMFControlStr CRMFControl; michael@0: typedef CERTGeneralName CRMFGeneralName; michael@0: typedef struct CRMFCertExtensionStr CRMFCertExtension; michael@0: michael@0: struct CRMFValidityCreationInfoStr { michael@0: PRTime *notBefore; michael@0: PRTime *notAfter; michael@0: }; michael@0: michael@0: struct CRMFCertExtCreationInfoStr { michael@0: CRMFCertExtension **extensions; michael@0: int numExtensions; michael@0: }; michael@0: michael@0: /* michael@0: * Some ASN1 Templates that may be needed. michael@0: */ michael@0: extern const SEC_ASN1Template CRMFCertReqMessagesTemplate[]; michael@0: extern const SEC_ASN1Template CRMFCertRequestTemplate[]; michael@0: michael@0: michael@0: #endif /*_CRMFT_H_*/