QEMU    
  X   ˆl–Ým_Jõ!¶e8 EpM\ ”Å£�þE$YÆÞ|�€-¾G�üÿÎ„DÍ_ˆI|¥�+y,a–ßi~” T¾R( 	Å+�~ãn©‹FÿÌ +Í    /* 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/. */

#ifndef _PKCS12T_H_
#define _PKCS12T_H_

#include "seccomon.h"
#include "secoid.h"
#include "cert.h"
#include "keythi.h"
#include "plarena.h"
#include "secpkcs7.h"
#include "secdig.h" /* for SGNDigestInfo */

typedef enum {
    SECPKCS12TargetTokenNoCAs,           /* CA get loaded intothe fixed token,
                                          * User certs go to target token */
    SECPKCS12TargetTokenIntermediateCAs, /* User certs and intermediates go to
                                          * target token, root certs got to
                                          * fixed token */
    SECPKCS12TargetTokenAllCAs           /* All certs go to target token */
} SECPKCS12TargetTokenCAs;

/* PKCS12 Structures */
typedef struct SEC_PKCS12PFXItemStr SEC_PKCS12PFXItem;
typedef struct SEC_PKCS12MacDataStr SEC_PKCS12MacData;
typedef struct SEC_PKCS12AuthenticatedSafeStr SEC_PKCS12AuthenticatedSafe;
typedef struct SEC_PKCS12BaggageItemStr SEC_PKCS12BaggageItem;
typedef struct SEC_PKCS12BaggageStr SEC_PKCS12Baggage;
typedef struct SEC_PKCS12Baggage_OLDStr SEC_PKCS12Baggage_OLD;
typedef struct SEC_PKCS12ESPVKItemStr SEC_PKCS12ESPVKItem;
typedef struct SEC_PKCS12PVKSupportingDataStr SEC_PKCS12PVKSupportingData;
typedef struct SEC_PKCS12PVKAdditionalDataStr SEC_PKCS12PVKAdditionalData;
typedef struct SEC_PKCS12SafeContentsStr SEC_PKCS12SafeContents;
typedef struct SEC_PKCS12SafeBagStr SEC_PKCS12SafeBag;
typedef struct SEC_PKCS12PrivateKeyStr SEC_PKCS12PrivateKey;
typedef struct SEC_PKCS12PrivateKeyBagStr SEC_PKCS12PrivateKeyBag;
typedef struct SEC_PKCS12CertAndCRLBagStr SEC_PKCS12CertAndCRLBag;
typedef struct SEC_PKCS12CertAndCRLStr SEC_PKCS12CertAndCRL;
typedef struct SEC_PKCS12X509CertCRLStr SEC_PKCS12X509CertCRL;
typedef struct SEC_PKCS12SDSICertStr SEC_PKCS12SDSICert;
typedef struct SEC_PKCS12SecretStr SEC_PKCS12Secret;
typedef struct SEC_PKCS12SecretAdditionalStr SEC_PKCS12SecretAdditional;
typedef struct SEC_PKCS12SecretItemStr SEC_PKCS12SecretItem;
typedef struct SEC_PKCS12SecretBagStr SEC_PKCS12SecretBag;

typedef SECItem *(*SEC_PKCS12PasswordFunc)(SECItem *args);

/* PKCS12 types */

/* stores shrouded keys */
struct SEC_PKCS12BaggageStr {
    PLArenaPool *poolp;
    SEC_PKCS12BaggageItem **bags;

    int luggage_size; /* used locally */
};

/* additional data to be associated with keys.  currently there
 * is nothing defined to be stored here.  allows future expansion.
 */
struct SEC_PKCS12PVKAdditionalDataStr {
    PLArenaPool *poolp;
    SECOidData *pvkAdditionalTypeTag; /* used locally */
    SECItem pvkAdditionalType;
    SECItem pvkAdditionalContent;
};

/* cert and other supporting data for private keys.  used
 * for both shrouded and non-shrouded keys.
 */
struct SEC_PKCS12PVKSupportingDataStr {
    PLArenaPool *poolp;
    SGNDigestInfo **assocCerts;
    SECItem regenerable;
    SECItem nickname;
    SEC_PKCS12PVKAdditionalData pvkAdditional;
    SECItem pvkAdditionalDER;

    SECItem uniNickName;
    /* used locally */
    int nThumbs;
};

/* shrouded key structure.  supports only pkcs8 shrouding
 * currently.
 */
struct SEC_PKCS12ESPVKItemStr {
    PLArenaPool *poolp;   /* used locally */
    SECOidData *espvkTag; /* used locally */
    SECItem espvkOID;
    SEC_PKCS12PVKSupportingData espvkData;
    union {
        SECKEYEncryptedPrivateKeyInfo *pkcs8KeyShroud;
    } espvkCipherText;

    PRBool duplicate;    /* used locally */
    PRBool problem_cert; /* used locally */
    PRBool single_cert;  /* used locally */
    int nCerts;          /* used locally */
    SECItem derCert;     /* used locally */
};

/* generic bag store for the safe.  safeBagType identifies
 * the type of bag stored.
 */
struct SEC_PKCS12SafeBagStr {
    PLArenaPool *poolp;
    SECOidData *safeBagTypeTag; /* used locally */
