Back to index

lightning-sunbird  0.9+nobinonly
Classes | Typedefs | Functions | Variables
pk11pk12.c File Reference
#include "seccomon.h"
#include "secmod.h"
#include "secmodi.h"
#include "pkcs11.h"
#include "pk11func.h"
#include "secitem.h"
#include "key.h"
#include "secoid.h"
#include "secasn1.h"
#include "secerr.h"

Go to the source code of this file.

Classes

struct  SECKEYRSAPrivateKeyStr
struct  SECKEYDSAPrivateKeyStr
struct  SECKEYDHPrivateKeyStr
struct  SECKEYRawPrivateKeyStr
union  SECKEYRawPrivateKeyStr.u

Typedefs

typedef struct SECKEYRSAPrivateKeyStr
typedef struct SECKEYDSAPrivateKeyStr
typedef struct SECKEYDHPrivateKeyStr
typedef struct SECKEYRawPrivateKeyStr

Functions

static void prepare_rsa_priv_key_export_for_asn1 (SECKEYRawPrivateKey *key)
static void prepare_dsa_priv_key_export_for_asn1 (SECKEYRawPrivateKey *key)
static void prepare_dh_priv_key_export_for_asn1 (SECKEYRawPrivateKey *key)
SECStatus PK11_ImportDERPrivateKeyInfo (PK11SlotInfo *slot, SECItem *derPKI, SECItem *nickname, SECItem *publicValue, PRBool isPerm, PRBool isPrivate, unsigned int keyUsage, void *wincx)
SECStatus PK11_ImportDERPrivateKeyInfoAndReturnKey (PK11SlotInfo *slot, SECItem *derPKI, SECItem *nickname, SECItem *publicValue, PRBool isPerm, PRBool isPrivate, unsigned int keyUsage, SECKEYPrivateKey **privk, void *wincx)
SECStatus PK11_ImportAndReturnPrivateKey (PK11SlotInfo *slot, SECKEYRawPrivateKey *lpk, SECItem *nickname, SECItem *publicValue, PRBool isPerm, PRBool isPrivate, unsigned int keyUsage, SECKEYPrivateKey **privk, void *wincx)
SECStatus PK11_ImportPrivateKey (PK11SlotInfo *slot, SECKEYRawPrivateKey *lpk, SECItem *nickname, SECItem *publicValue, PRBool isPerm, PRBool isPrivate, unsigned int keyUsage, void *wincx)
SECStatus PK11_ImportPrivateKeyInfoAndReturnKey (PK11SlotInfo *slot, SECKEYPrivateKeyInfo *pki, SECItem *nickname, SECItem *publicValue, PRBool isPerm, PRBool isPrivate, unsigned int keyUsage, SECKEYPrivateKey **privk, void *wincx)
SECStatus PK11_ImportPrivateKeyInfo (PK11SlotInfo *slot, SECKEYPrivateKeyInfo *pki, SECItem *nickname, SECItem *publicValue, PRBool isPerm, PRBool isPrivate, unsigned int keyUsage, void *wincx)

Variables

const SEC_ASN1Template SECKEY_AttributeTemplate []
const SEC_ASN1Template SECKEY_SetOfAttributeTemplate []
const SEC_ASN1Template SECKEY_PrivateKeyInfoTemplate []
const SEC_ASN1Template SECKEY_PointerToPrivateKeyInfoTemplate []
const SEC_ASN1Template SECKEY_RSAPrivateKeyExportTemplate []
const SEC_ASN1Template SECKEY_DSAPrivateKeyExportTemplate []
const SEC_ASN1Template SECKEY_DHPrivateKeyExportTemplate []
const SEC_ASN1Template SECKEY_EncryptedPrivateKeyInfoTemplate []
const SEC_ASN1Template SECKEY_PointerToEncryptedPrivateKeyInfoTemplate []

Class Documentation

struct SECKEYRSAPrivateKeyStr

Definition at line 64 of file pk11pk12.c.

Class Members
PRArenaPool * arena
SECItem coefficient
SECItem exponent1
SECItem exponent2
SECItem modulus
SECItem prime1
SECItem prime2
SECItem privateExponent
SECItem publicExponent
SECItem version
struct SECKEYDSAPrivateKeyStr

Definition at line 83 of file pk11pk12.c.

Class Members
SECKEYPQGParams params
SECItem privateValue
struct SECKEYDHPrivateKeyStr

Definition at line 93 of file pk11pk12.c.

Class Members
PRArenaPool * arena
SECItem base
SECItem prime
SECItem privateValue
struct SECKEYRawPrivateKeyStr

Definition at line 104 of file pk11pk12.c.

Collaboration diagram for SECKEYRawPrivateKeyStr:
Class Members
PLArenaPool * arena
KeyType keyType
union SECKEYRawPrivateKeyStr u
union SECKEYRawPrivateKeyStr u
union SECKEYRawPrivateKeyStr.u

Definition at line 107 of file pk11pk12.c.

Class Members
SECKEYDHPrivateKey dh
SECKEYDSAPrivateKey dsa
SECKEYRSAPrivateKey rsa

Typedef Documentation

typedef struct SECKEYDHPrivateKeyStr

Definition at line 99 of file pk11pk12.c.

typedef struct SECKEYDSAPrivateKeyStr

Definition at line 87 of file pk11pk12.c.

typedef struct SECKEYRawPrivateKeyStr

Definition at line 113 of file pk11pk12.c.

typedef struct SECKEYRSAPrivateKeyStr

Definition at line 76 of file pk11pk12.c.


Function Documentation

SECStatus PK11_ImportAndReturnPrivateKey ( PK11SlotInfo *  slot,
SECKEYRawPrivateKey *  lpk,
SECItem *  nickname,
SECItem *  publicValue,
PRBool  isPerm,
PRBool  isPrivate,
unsigned int  keyUsage,
SECKEYPrivateKey **  privk,
void wincx 
)

Definition at line 278 of file pk11pk12.c.

{
    CK_BBOOL cktrue = CK_TRUE;
    CK_BBOOL ckfalse = CK_FALSE;
    CK_OBJECT_CLASS keyClass = CKO_PRIVATE_KEY;
    CK_KEY_TYPE keyType = CKK_RSA;
    CK_OBJECT_HANDLE objectID;
    CK_ATTRIBUTE theTemplate[20];
    int templateCount = 0;
    SECStatus rv = SECFailure;
    PRArenaPool *arena;
    CK_ATTRIBUTE *attrs;
    CK_ATTRIBUTE *signedattr = NULL;
    int signedcount = 0;
    CK_ATTRIBUTE *ap;
    SECItem *ck_id = NULL;

    arena = PORT_NewArena(2048);
    if(!arena) {
       return SECFailure;
    }

    attrs = theTemplate;


    PK11_SETATTRS(attrs, CKA_CLASS, &keyClass, sizeof(keyClass) ); attrs++;
    PK11_SETATTRS(attrs, CKA_KEY_TYPE, &keyType, sizeof(keyType) ); attrs++;
    PK11_SETATTRS(attrs, CKA_TOKEN, isPerm ? &cktrue : &ckfalse, 
                                          sizeof(CK_BBOOL) ); attrs++;
    PK11_SETATTRS(attrs, CKA_SENSITIVE, isPrivate ? &cktrue : &ckfalse, 
                                          sizeof(CK_BBOOL) ); attrs++;
    PK11_SETATTRS(attrs, CKA_PRIVATE, isPrivate ? &cktrue : &ckfalse,
                                           sizeof(CK_BBOOL) ); attrs++;

    switch (lpk->keyType) {
    case rsaKey:
           keyType = CKK_RSA;
           PK11_SETATTRS(attrs, CKA_UNWRAP, (keyUsage & KU_KEY_ENCIPHERMENT) ?
                            &cktrue : &ckfalse, sizeof(CK_BBOOL) ); attrs++;
           PK11_SETATTRS(attrs, CKA_DECRYPT, (keyUsage & KU_DATA_ENCIPHERMENT) ?
                            &cktrue : &ckfalse, sizeof(CK_BBOOL) ); attrs++;
           PK11_SETATTRS(attrs, CKA_SIGN, (keyUsage & KU_DIGITAL_SIGNATURE) ? 
                            &cktrue : &ckfalse, sizeof(CK_BBOOL) ); attrs++;
           PK11_SETATTRS(attrs, CKA_SIGN_RECOVER, 
                            (keyUsage & KU_DIGITAL_SIGNATURE) ? 
                            &cktrue : &ckfalse, sizeof(CK_BBOOL) ); attrs++;
           ck_id = PK11_MakeIDFromPubKey(&lpk->u.rsa.modulus);
           if (ck_id == NULL) {
              goto loser;
           }
           PK11_SETATTRS(attrs, CKA_ID, ck_id->data,ck_id->len); attrs++;
           if (nickname) {
              PK11_SETATTRS(attrs, CKA_LABEL, nickname->data, nickname->len); attrs++; 
           } 
           signedattr = attrs;
           PK11_SETATTRS(attrs, CKA_MODULUS, lpk->u.rsa.modulus.data,
                                          lpk->u.rsa.modulus.len); attrs++;
           PK11_SETATTRS(attrs, CKA_PUBLIC_EXPONENT, 
                            lpk->u.rsa.publicExponent.data,
                            lpk->u.rsa.publicExponent.len); attrs++;
           PK11_SETATTRS(attrs, CKA_PRIVATE_EXPONENT, 
                            lpk->u.rsa.privateExponent.data,
                            lpk->u.rsa.privateExponent.len); attrs++;
           PK11_SETATTRS(attrs, CKA_PRIME_1, 
                            lpk->u.rsa.prime1.data,
                            lpk->u.rsa.prime1.len); attrs++;
           PK11_SETATTRS(attrs, CKA_PRIME_2, 
                            lpk->u.rsa.prime2.data,
                            lpk->u.rsa.prime2.len); attrs++;
           PK11_SETATTRS(attrs, CKA_EXPONENT_1, 
                            lpk->u.rsa.exponent1.data,
                            lpk->u.rsa.exponent1.len); attrs++;
           PK11_SETATTRS(attrs, CKA_EXPONENT_2, 
                            lpk->u.rsa.exponent2.data,
                            lpk->u.rsa.exponent2.len); attrs++;
           PK11_SETATTRS(attrs, CKA_COEFFICIENT, 
                            lpk->u.rsa.coefficient.data,
                            lpk->u.rsa.coefficient.len); attrs++;
           break;
    case dsaKey:
           keyType = CKK_DSA;
           /* To make our intenal PKCS #11 module work correctly with 
            * our database, we need to pass in the public key value for 
            * this dsa key. We have a netscape only CKA_ value to do this.
            * Only send it to internal slots */
           if( publicValue == NULL ) {
              goto loser;
           }
           if (PK11_IsInternal(slot)) {
               PK11_SETATTRS(attrs, CKA_NETSCAPE_DB,
                            publicValue->data, publicValue->len); attrs++;
           }
           PK11_SETATTRS(attrs, CKA_SIGN, &cktrue, sizeof(CK_BBOOL)); attrs++;
           PK11_SETATTRS(attrs, CKA_SIGN_RECOVER, &cktrue, sizeof(CK_BBOOL)); attrs++;
           if(nickname) {
              PK11_SETATTRS(attrs, CKA_LABEL, nickname->data, nickname->len);
              attrs++; 
           } 
           ck_id = PK11_MakeIDFromPubKey(publicValue);
           if (ck_id == NULL) {
              goto loser;
           }
           PK11_SETATTRS(attrs, CKA_ID, ck_id->data,ck_id->len); attrs++;
           signedattr = attrs;
           PK11_SETATTRS(attrs, CKA_PRIME,    lpk->u.dsa.params.prime.data,
                            lpk->u.dsa.params.prime.len); attrs++;
           PK11_SETATTRS(attrs,CKA_SUBPRIME,lpk->u.dsa.params.subPrime.data,
                            lpk->u.dsa.params.subPrime.len); attrs++;
           PK11_SETATTRS(attrs, CKA_BASE,  lpk->u.dsa.params.base.data,
                                   lpk->u.dsa.params.base.len); attrs++;
           PK11_SETATTRS(attrs, CKA_VALUE,    lpk->u.dsa.privateValue.data, 
                                   lpk->u.dsa.privateValue.len); attrs++;
           break;
     case dhKey:
           keyType = CKK_DH;
           /* To make our intenal PKCS #11 module work correctly with 
            * our database, we need to pass in the public key value for 
            * this dh key. We have a netscape only CKA_ value to do this.
            * Only send it to internal slots */
           if (PK11_IsInternal(slot)) {
               PK11_SETATTRS(attrs, CKA_NETSCAPE_DB,
                            publicValue->data, publicValue->len); attrs++;
           }
           PK11_SETATTRS(attrs, CKA_DERIVE, &cktrue, sizeof(CK_BBOOL)); attrs++;
           if(nickname) {
              PK11_SETATTRS(attrs, CKA_LABEL, nickname->data, nickname->len);
              attrs++; 
           } 
           ck_id = PK11_MakeIDFromPubKey(publicValue);
           if (ck_id == NULL) {
              goto loser;
           }
           PK11_SETATTRS(attrs, CKA_ID, ck_id->data,ck_id->len); attrs++;
           signedattr = attrs;
           PK11_SETATTRS(attrs, CKA_PRIME,    lpk->u.dh.prime.data,
                            lpk->u.dh.prime.len); attrs++;
           PK11_SETATTRS(attrs, CKA_BASE,  lpk->u.dh.base.data,
                                   lpk->u.dh.base.len); attrs++;
           PK11_SETATTRS(attrs, CKA_VALUE,    lpk->u.dh.privateValue.data, 
                                   lpk->u.dh.privateValue.len); attrs++;
           break;
       /* what about fortezza??? */
    default:
           PORT_SetError(SEC_ERROR_BAD_KEY);
           goto loser;
    }
    templateCount = attrs - theTemplate;
    PORT_Assert(templateCount <= sizeof(theTemplate)/sizeof(CK_ATTRIBUTE));
    PORT_Assert(signedattr != NULL);
    signedcount = attrs - signedattr;

    for (ap=signedattr; signedcount; ap++, signedcount--) {
       pk11_SignedToUnsigned(ap);
    }

    rv = PK11_CreateNewObject(slot, CK_INVALID_SESSION,
                     theTemplate, templateCount, isPerm, &objectID);

    /* create and return a SECKEYPrivateKey */
    if( rv == SECSuccess && privk != NULL) {
       *privk = PK11_MakePrivKey(slot, lpk->keyType, !isPerm, objectID, wincx);
       if( *privk == NULL ) {
           rv = SECFailure;
       }
    }
loser:
    if (ck_id) {
       SECITEM_ZfreeItem(ck_id, PR_TRUE);
    }
    return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

SECStatus PK11_ImportDERPrivateKeyInfo ( PK11SlotInfo *  slot,
SECItem *  derPKI,
SECItem *  nickname,
SECItem *  publicValue,
PRBool  isPerm,
PRBool  isPrivate,
unsigned int  keyUsage,
void wincx 
)

Definition at line 234 of file pk11pk12.c.

{
    return PK11_ImportDERPrivateKeyInfoAndReturnKey(slot, derPKI,
       nickname, publicValue, isPerm, isPrivate, keyUsage, NULL, wincx);
}
SECStatus PK11_ImportDERPrivateKeyInfoAndReturnKey ( PK11SlotInfo *  slot,
SECItem *  derPKI,
SECItem *  nickname,
SECItem *  publicValue,
PRBool  isPerm,
PRBool  isPrivate,
unsigned int  keyUsage,
SECKEYPrivateKey **  privk,
void wincx 
)

Definition at line 243 of file pk11pk12.c.

{
    SECKEYPrivateKeyInfo *pki = NULL;
    PRArenaPool *temparena = NULL;
    SECStatus rv = SECFailure;

    temparena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
    if (!temparena)
        return rv;
    pki = PORT_ArenaZNew(temparena, SECKEYPrivateKeyInfo);
    if (!pki) {
        PORT_FreeArena(temparena, PR_FALSE);
        return rv;
    }
    pki->arena = temparena;

    rv = SEC_ASN1DecodeItem(pki->arena, pki, SECKEY_PrivateKeyInfoTemplate,
              derPKI);
    if( rv != SECSuccess ) {
       goto finish;
    }

    rv = PK11_ImportPrivateKeyInfoAndReturnKey(slot, pki, nickname,
              publicValue, isPerm, isPrivate, keyUsage, privk, wincx);

finish:
    /* this zeroes the key and frees the arena */
    SECKEY_DestroyPrivateKeyInfo(pki, PR_TRUE /*freeit*/);
    return rv;
}

Here is the caller graph for this function:

SECStatus PK11_ImportPrivateKey ( PK11SlotInfo *  slot,
SECKEYRawPrivateKey *  lpk,
SECItem *  nickname,
SECItem *  publicValue,
PRBool  isPerm,
PRBool  isPrivate,
unsigned int  keyUsage,
void wincx 
)

Definition at line 454 of file pk11pk12.c.

{
    return PK11_ImportAndReturnPrivateKey(slot, lpk, nickname, publicValue,
       isPerm, isPrivate, keyUsage, NULL, wincx);
}

Here is the call graph for this function:

SECStatus PK11_ImportPrivateKeyInfo ( PK11SlotInfo *  slot,
SECKEYPrivateKeyInfo *  pki,
SECItem *  nickname,
SECItem *  publicValue,
PRBool  isPerm,
PRBool  isPrivate,
unsigned int  keyUsage,
void wincx 
)

Definition at line 554 of file pk11pk12.c.

{
    return PK11_ImportPrivateKeyInfoAndReturnKey(slot, pki, nickname,
       publicValue, isPerm, isPrivate, keyUsage, NULL, wincx);

}

Here is the caller graph for this function:

SECStatus PK11_ImportPrivateKeyInfoAndReturnKey ( PK11SlotInfo *  slot,
SECKEYPrivateKeyInfo *  pki,
SECItem *  nickname,
SECItem *  publicValue,
PRBool  isPerm,
PRBool  isPrivate,
unsigned int  keyUsage,
SECKEYPrivateKey **  privk,
void wincx 
)

Definition at line 463 of file pk11pk12.c.

{
    CK_KEY_TYPE keyType = CKK_RSA;
    SECStatus rv = SECFailure;
    SECKEYRawPrivateKey *lpk = NULL;
    const SEC_ASN1Template *keyTemplate, *paramTemplate;
    void *paramDest = NULL;
    PRArenaPool *arena;

    arena = PORT_NewArena(2048);
    if(!arena) {
       return SECFailure;
    }

    /* need to change this to use RSA/DSA keys */
    lpk = (SECKEYRawPrivateKey *)PORT_ArenaZAlloc(arena,
                                            sizeof(SECKEYRawPrivateKey));
    if(lpk == NULL) {
       goto loser;
    }
    lpk->arena = arena;

    switch(SECOID_GetAlgorithmTag(&pki->algorithm)) {
       case SEC_OID_PKCS1_RSA_ENCRYPTION:
           prepare_rsa_priv_key_export_for_asn1(lpk);
           keyTemplate = SECKEY_RSAPrivateKeyExportTemplate;
           paramTemplate = NULL;
           paramDest = NULL;
           lpk->keyType = rsaKey;
           keyType = CKK_RSA;
           break;
       case SEC_OID_ANSIX9_DSA_SIGNATURE:
           prepare_dsa_priv_key_export_for_asn1(lpk);
           keyTemplate = SECKEY_DSAPrivateKeyExportTemplate;
           paramTemplate = SECKEY_PQGParamsTemplate;
           paramDest = &(lpk->u.dsa.params);
           lpk->keyType = dsaKey;
           keyType = CKK_DSA;
           break;
       case SEC_OID_X942_DIFFIE_HELMAN_KEY:
           if(!publicValue) {
              goto loser;
           }
           prepare_dh_priv_key_export_for_asn1(lpk);
           keyTemplate = SECKEY_DHPrivateKeyExportTemplate;
           paramTemplate = NULL;
           paramDest = NULL;
           lpk->keyType = dhKey;
           keyType = CKK_DH;
           break;

       default:
           keyTemplate   = NULL;
           paramTemplate = NULL;
           paramDest     = NULL;
           break;
    }

    if(!keyTemplate) {
       goto loser;
    }

    /* decode the private key and any algorithm parameters */
    rv = SEC_ASN1DecodeItem(arena, lpk, keyTemplate, &pki->privateKey);
    if(rv != SECSuccess) {
       goto loser;
    }
    if(paramDest && paramTemplate) {
       rv = SEC_ASN1DecodeItem(arena, paramDest, paramTemplate, 
                             &(pki->algorithm.parameters));
       if(rv != SECSuccess) {
           goto loser;
       }
    }

    rv = PK11_ImportAndReturnPrivateKey(slot,lpk,nickname,publicValue, isPerm, 
       isPrivate,  keyUsage, privk, wincx);


loser:
    if (lpk!= NULL) {
       PORT_FreeArena(arena, PR_TRUE);
    }

    return rv;
}

Here is the caller graph for this function:

static void prepare_dh_priv_key_export_for_asn1 ( SECKEYRawPrivateKey *  key) [static]

Definition at line 225 of file pk11pk12.c.

{
    key->u.dh.privateValue.type = siUnsignedInteger;
    key->u.dh.prime.type = siUnsignedInteger;
    key->u.dh.base.type = siUnsignedInteger;
}

Here is the caller graph for this function:

static void prepare_dsa_priv_key_export_for_asn1 ( SECKEYRawPrivateKey *  key) [static]

Definition at line 216 of file pk11pk12.c.

{
    key->u.dsa.privateValue.type = siUnsignedInteger;
    key->u.dsa.params.prime.type = siUnsignedInteger;
    key->u.dsa.params.subPrime.type = siUnsignedInteger;
    key->u.dsa.params.base.type = siUnsignedInteger;
}

Here is the caller graph for this function:

static void prepare_rsa_priv_key_export_for_asn1 ( SECKEYRawPrivateKey *  key) [static]

Definition at line 203 of file pk11pk12.c.

{
    key->u.rsa.modulus.type = siUnsignedInteger;
    key->u.rsa.publicExponent.type = siUnsignedInteger;
    key->u.rsa.privateExponent.type = siUnsignedInteger;
    key->u.rsa.prime1.type = siUnsignedInteger;
    key->u.rsa.prime2.type = siUnsignedInteger;
    key->u.rsa.exponent1.type = siUnsignedInteger;
    key->u.rsa.exponent2.type = siUnsignedInteger;
    key->u.rsa.coefficient.type = siUnsignedInteger;
}

Here is the caller graph for this function:


Variable Documentation

Initial value:
 {
    { SEC_ASN1_SEQUENCE,
        0, NULL, sizeof(SECKEYAttribute) },
    { SEC_ASN1_OBJECT_ID, offsetof(SECKEYAttribute, attrType) },
    { SEC_ASN1_SET_OF, offsetof(SECKEYAttribute, attrValue),
        SEC_AnyTemplate },
    { 0 }
}

Definition at line 120 of file pk11pk12.c.

Initial value:
 {
    { SEC_ASN1_INTEGER, offsetof(SECKEYRawPrivateKey,u.dh.privateValue) },
    { SEC_ASN1_INTEGER, offsetof(SECKEYRawPrivateKey,u.dh.base) },
    { SEC_ASN1_INTEGER, offsetof(SECKEYRawPrivateKey,u.dh.prime) },
}

Definition at line 167 of file pk11pk12.c.

Initial value:
 {
    { SEC_ASN1_INTEGER, offsetof(SECKEYRawPrivateKey,u.dsa.privateValue) },
}

Definition at line 163 of file pk11pk12.c.

Initial value:
 {
    { SEC_ASN1_SEQUENCE,
        0, NULL, sizeof(SECKEYEncryptedPrivateKeyInfo) },
    { SEC_ASN1_INLINE,
        offsetof(SECKEYEncryptedPrivateKeyInfo,algorithm),
        SECOID_AlgorithmIDTemplate },
    { SEC_ASN1_OCTET_STRING,
        offsetof(SECKEYEncryptedPrivateKeyInfo,encryptedData) },
    { 0 }
}

Definition at line 173 of file pk11pk12.c.

Initial value:

Definition at line 184 of file pk11pk12.c.

Initial value:

Definition at line 145 of file pk11pk12.c.

Initial value:
 {
    { SEC_ASN1_SEQUENCE, 0, NULL, sizeof(SECKEYPrivateKeyInfo) },
    { SEC_ASN1_INTEGER, offsetof(SECKEYPrivateKeyInfo,version) },
    { SEC_ASN1_INLINE, offsetof(SECKEYPrivateKeyInfo,algorithm),
        SECOID_AlgorithmIDTemplate },
    { SEC_ASN1_OCTET_STRING, offsetof(SECKEYPrivateKeyInfo,privateKey) },
    { SEC_ASN1_OPTIONAL | SEC_ASN1_CONSTRUCTED | SEC_ASN1_CONTEXT_SPECIFIC | 0,
        offsetof(SECKEYPrivateKeyInfo,attributes),
        SECKEY_SetOfAttributeTemplate },
    { 0 }
}

Definition at line 133 of file pk11pk12.c.

Initial value:
 {
    { SEC_ASN1_SEQUENCE, 0, NULL, sizeof(SECKEYRawPrivateKey) },
    { SEC_ASN1_INTEGER, offsetof(SECKEYRawPrivateKey,u.rsa.version) },
    { SEC_ASN1_INTEGER, offsetof(SECKEYRawPrivateKey,u.rsa.modulus) },
    { SEC_ASN1_INTEGER, offsetof(SECKEYRawPrivateKey,u.rsa.publicExponent) },
    { SEC_ASN1_INTEGER, offsetof(SECKEYRawPrivateKey,u.rsa.privateExponent) },
    { SEC_ASN1_INTEGER, offsetof(SECKEYRawPrivateKey,u.rsa.prime1) },
    { SEC_ASN1_INTEGER, offsetof(SECKEYRawPrivateKey,u.rsa.prime2) },
    { SEC_ASN1_INTEGER, offsetof(SECKEYRawPrivateKey,u.rsa.exponent1) },
    { SEC_ASN1_INTEGER, offsetof(SECKEYRawPrivateKey,u.rsa.exponent2) },
    { SEC_ASN1_INTEGER, offsetof(SECKEYRawPrivateKey,u.rsa.coefficient) },
    { 0 }
}

Definition at line 149 of file pk11pk12.c.

Initial value:

Definition at line 129 of file pk11pk12.c.