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