privKey->keyType = rsaKey;
privKey->keyType = lowRSAKey;
pk11_mkSecretKeyRep(PK11Object *object){    SECKEYLowPrivateKey *privKey;    PLArenaPool *arena = 0;    CK_RV crv;    SECStatus rv;    static unsigned char derZero[1] = { 0 };    arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);    if (arena == NULL) { crv = CKR_HOST_MEMORY; goto loser; }    privKey = (SECKEYLowPrivateKey *)			PORT_ArenaAlloc(arena,sizeof(SECKEYLowPrivateKey));    if (privKey == NULL) { crv = CKR_HOST_MEMORY; goto loser; }    privKey->arena = arena;    /* Secret keys are represented in the database as "fake" RSA keys.  The RSA key     * is marked as a secret key representation by setting the public exponent field     * to 0, which is an invalid RSA exponent.  The other fields are set as follows:     *   modulus - CKA_ID value for the secret key     *   private exponent - CKA_VALUE (the key itself)     *   coefficient - CKA_KEY_TYPE, which indicates what encryption algorithm     *      is used for the key.     *   all others - set to integer 0     */    privKey->keyType = rsaKey;    /* The modulus is set to the key id of the symmetric key */    crv=pk11_Attribute2SecItem(arena,&privKey->u.rsa.modulus,object,CKA_ID);    if (crv != CKR_OK) goto loser;    /* The public exponent is set to 0 length to indicate a special key */    privKey->u.rsa.publicExponent.len = sizeof derZero;    privKey->u.rsa.publicExponent.data = derZero;    /* The private exponent is the actual key value */    crv=pk11_Attribute2SecItem(arena,&privKey->u.rsa.privateExponent,object,CKA_VALUE);    if (crv != CKR_OK) goto loser;    /* All other fields empty - needs testing */    privKey->u.rsa.prime1.len = sizeof derZero;    privKey->u.rsa.prime1.data = derZero;    privKey->u.rsa.prime2.len = sizeof derZero;    privKey->u.rsa.prime2.data = derZero;    privKey->u.rsa.exponent1.len = sizeof derZero;    privKey->u.rsa.exponent1.data = derZero;    privKey->u.rsa.exponent2.len = sizeof derZero;    privKey->u.rsa.exponent2.data = derZero;    /* Coeficient set to KEY_TYPE */    crv=pk11_Attribute2SecItem(arena,&privKey->u.rsa.coefficient,object,CKA_KEY_TYPE);    if (crv != CKR_OK) goto loser;    /* Private key version field set normally for compatibility */    rv = DER_SetUInteger(privKey->arena, &privKey->u.rsa.version,SEC_PRIVATE_KEY_VERSION);    if (rv != SECSuccess) { crv = CKR_HOST_MEMORY; goto loser; }loser:    if (crv != CKR_OK) {	PORT_FreeArena(arena,PR_FALSE);	privKey = 0;    }    return privKey;}