Blame nss/lib/softoken/lowkeyi.h

Packit 40b132
/* This Source Code Form is subject to the terms of the Mozilla Public
Packit 40b132
 * License, v. 2.0. If a copy of the MPL was not distributed with this
Packit 40b132
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
Packit 40b132
Packit 40b132
#ifndef _LOWKEYI_H_
Packit 40b132
#define _LOWKEYI_H_
Packit 40b132
Packit 40b132
#include "prtypes.h"
Packit 40b132
#include "seccomon.h"
Packit 40b132
#include "secoidt.h"
Packit 40b132
#include "lowkeyti.h"
Packit 40b132
Packit 40b132
SEC_BEGIN_PROTOS
Packit 40b132
Packit 40b132
/*
Packit 40b132
 * See bugzilla bug 125359
Packit 40b132
 * Since NSS (via PKCS#11) wants to handle big integers as unsigned ints,
Packit 40b132
 * all of the templates above that en/decode into integers must be converted
Packit 40b132
 * from ASN.1's signed integer type.  This is done by marking either the
Packit 40b132
 * source or destination (encoding or decoding, respectively) type as
Packit 40b132
 * siUnsignedInteger.
Packit 40b132
 */
Packit 40b132
extern void prepare_low_rsa_priv_key_for_asn1(NSSLOWKEYPrivateKey *key);
Packit 40b132
extern void prepare_low_pqg_params_for_asn1(PQGParams *params);
Packit 40b132
extern void prepare_low_dsa_priv_key_for_asn1(NSSLOWKEYPrivateKey *key);
Packit 40b132
extern void prepare_low_dsa_priv_key_export_for_asn1(NSSLOWKEYPrivateKey *key);
Packit 40b132
extern void prepare_low_dh_priv_key_for_asn1(NSSLOWKEYPrivateKey *key);
Packit 40b132
#ifndef NSS_DISABLE_ECC
Packit 40b132
extern void prepare_low_ec_priv_key_for_asn1(NSSLOWKEYPrivateKey *key);
Packit 40b132
extern void prepare_low_ecparams_for_asn1(ECParams *params);
Packit 40b132
#endif /* NSS_DISABLE_ECC */
Packit 40b132
Packit 40b132
/*
Packit 40b132
** Destroy a private key object.
Packit 40b132
**	"key" the object
Packit 40b132
**	"freeit" if PR_TRUE then free the object as well as its sub-objects
Packit 40b132
*/
Packit 40b132
extern void nsslowkey_DestroyPrivateKey(NSSLOWKEYPrivateKey *key);
Packit 40b132
Packit 40b132
/*
Packit 40b132
** Destroy a public key object.
Packit 40b132
**	"key" the object
Packit 40b132
**	"freeit" if PR_TRUE then free the object as well as its sub-objects
Packit 40b132
*/
Packit 40b132
extern void nsslowkey_DestroyPublicKey(NSSLOWKEYPublicKey *key);
Packit 40b132
Packit 40b132
/*
Packit 40b132
** Return the modulus length of "pubKey".
Packit 40b132
*/
Packit 40b132
extern unsigned int nsslowkey_PublicModulusLen(NSSLOWKEYPublicKey *pubKey);
Packit 40b132
Packit 40b132
Packit 40b132
/*
Packit 40b132
** Return the modulus length of "privKey".
Packit 40b132
*/
Packit 40b132
extern unsigned int nsslowkey_PrivateModulusLen(NSSLOWKEYPrivateKey *privKey);
Packit 40b132
Packit 40b132
Packit 40b132
/*
Packit 40b132
** Convert a low private key "privateKey" into a public low key
Packit 40b132
*/
Packit 40b132
extern NSSLOWKEYPublicKey 
Packit 40b132
		*nsslowkey_ConvertToPublicKey(NSSLOWKEYPrivateKey *privateKey);
Packit 40b132
Packit 40b132
/* Make a copy of a low private key in it's own arena.
Packit 40b132
 * a return of NULL indicates an error.
Packit 40b132
 */
Packit 40b132
extern NSSLOWKEYPrivateKey *
Packit 40b132
nsslowkey_CopyPrivateKey(NSSLOWKEYPrivateKey *privKey);
Packit 40b132
Packit 40b132
Packit 40b132
SEC_END_PROTOS
Packit 40b132
Packit 40b132
#endif /* _LOWKEYI_H_ */