security/nss/lib/softoken/lowkeyi.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #ifndef _LOWKEYI_H_
     6 #define _LOWKEYI_H_
     8 #include "prtypes.h"
     9 #include "seccomon.h"
    10 #include "secoidt.h"
    11 #include "lowkeyti.h"
    13 SEC_BEGIN_PROTOS
    15 /*
    16  * See bugzilla bug 125359
    17  * Since NSS (via PKCS#11) wants to handle big integers as unsigned ints,
    18  * all of the templates above that en/decode into integers must be converted
    19  * from ASN.1's signed integer type.  This is done by marking either the
    20  * source or destination (encoding or decoding, respectively) type as
    21  * siUnsignedInteger.
    22  */
    23 extern void prepare_low_rsa_priv_key_for_asn1(NSSLOWKEYPrivateKey *key);
    24 extern void prepare_low_pqg_params_for_asn1(PQGParams *params);
    25 extern void prepare_low_dsa_priv_key_for_asn1(NSSLOWKEYPrivateKey *key);
    26 extern void prepare_low_dsa_priv_key_export_for_asn1(NSSLOWKEYPrivateKey *key);
    27 extern void prepare_low_dh_priv_key_for_asn1(NSSLOWKEYPrivateKey *key);
    28 #ifndef NSS_DISABLE_ECC
    29 extern void prepare_low_ec_priv_key_for_asn1(NSSLOWKEYPrivateKey *key);
    30 extern void prepare_low_ecparams_for_asn1(ECParams *params);
    31 #endif /* NSS_DISABLE_ECC */
    33 /*
    34 ** Destroy a private key object.
    35 **	"key" the object
    36 **	"freeit" if PR_TRUE then free the object as well as its sub-objects
    37 */
    38 extern void nsslowkey_DestroyPrivateKey(NSSLOWKEYPrivateKey *key);
    40 /*
    41 ** Destroy a public key object.
    42 **	"key" the object
    43 **	"freeit" if PR_TRUE then free the object as well as its sub-objects
    44 */
    45 extern void nsslowkey_DestroyPublicKey(NSSLOWKEYPublicKey *key);
    47 /*
    48 ** Return the modulus length of "pubKey".
    49 */
    50 extern unsigned int nsslowkey_PublicModulusLen(NSSLOWKEYPublicKey *pubKey);
    53 /*
    54 ** Return the modulus length of "privKey".
    55 */
    56 extern unsigned int nsslowkey_PrivateModulusLen(NSSLOWKEYPrivateKey *privKey);
    59 /*
    60 ** Convert a low private key "privateKey" into a public low key
    61 */
    62 extern NSSLOWKEYPublicKey 
    63 		*nsslowkey_ConvertToPublicKey(NSSLOWKEYPrivateKey *privateKey);
    65 /* Make a copy of a low private key in it's own arena.
    66  * a return of NULL indicates an error.
    67  */
    68 extern NSSLOWKEYPrivateKey *
    69 nsslowkey_CopyPrivateKey(NSSLOWKEYPrivateKey *privKey);
    72 SEC_END_PROTOS
    74 #endif /* _LOWKEYI_H_ */

mercurial