OLD | NEW |
| (Empty) |
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/. */ | |
4 /* $Id: lowkeyi.h,v 1.12 2012/04/25 14:50:10 gerv%gerv.net Exp $ */ | |
5 | |
6 #ifndef _LOWKEYI_H_ | |
7 #define _LOWKEYI_H_ | |
8 | |
9 #include "prtypes.h" | |
10 #include "seccomon.h" | |
11 #include "secoidt.h" | |
12 #include "lowkeyti.h" | |
13 | |
14 SEC_BEGIN_PROTOS | |
15 | |
16 /* | |
17 * See bugzilla bug 125359 | |
18 * Since NSS (via PKCS#11) wants to handle big integers as unsigned ints, | |
19 * all of the templates above that en/decode into integers must be converted | |
20 * from ASN.1's signed integer type. This is done by marking either the | |
21 * source or destination (encoding or decoding, respectively) type as | |
22 * siUnsignedInteger. | |
23 */ | |
24 extern void prepare_low_rsa_priv_key_for_asn1(NSSLOWKEYPrivateKey *key); | |
25 extern void prepare_low_pqg_params_for_asn1(PQGParams *params); | |
26 extern void prepare_low_dsa_priv_key_for_asn1(NSSLOWKEYPrivateKey *key); | |
27 extern void prepare_low_dsa_priv_key_export_for_asn1(NSSLOWKEYPrivateKey *key); | |
28 extern void prepare_low_dh_priv_key_for_asn1(NSSLOWKEYPrivateKey *key); | |
29 #ifdef NSS_ENABLE_ECC | |
30 extern void prepare_low_ec_priv_key_for_asn1(NSSLOWKEYPrivateKey *key); | |
31 extern void prepare_low_ecparams_for_asn1(ECParams *params); | |
32 #endif /* NSS_ENABLE_ECC */ | |
33 | |
34 /* | |
35 ** Destroy a private key object. | |
36 ** "key" the object | |
37 ** "freeit" if PR_TRUE then free the object as well as its sub-objects | |
38 */ | |
39 extern void nsslowkey_DestroyPrivateKey(NSSLOWKEYPrivateKey *key); | |
40 | |
41 /* | |
42 ** Destroy a public key object. | |
43 ** "key" the object | |
44 ** "freeit" if PR_TRUE then free the object as well as its sub-objects | |
45 */ | |
46 extern void nsslowkey_DestroyPublicKey(NSSLOWKEYPublicKey *key); | |
47 | |
48 /* | |
49 ** Return the modulus length of "pubKey". | |
50 */ | |
51 extern unsigned int nsslowkey_PublicModulusLen(NSSLOWKEYPublicKey *pubKey); | |
52 | |
53 | |
54 /* | |
55 ** Return the modulus length of "privKey". | |
56 */ | |
57 extern unsigned int nsslowkey_PrivateModulusLen(NSSLOWKEYPrivateKey *privKey); | |
58 | |
59 | |
60 /* | |
61 ** Convert a low private key "privateKey" into a public low key | |
62 */ | |
63 extern NSSLOWKEYPublicKey | |
64 *nsslowkey_ConvertToPublicKey(NSSLOWKEYPrivateKey *privateKey); | |
65 | |
66 /* Make a copy of a low private key in it's own arena. | |
67 * a return of NULL indicates an error. | |
68 */ | |
69 extern NSSLOWKEYPrivateKey * | |
70 nsslowkey_CopyPrivateKey(NSSLOWKEYPrivateKey *privKey); | |
71 | |
72 | |
73 SEC_END_PROTOS | |
74 | |
75 #endif /* _LOWKEYI_H_ */ | |
OLD | NEW |