PageRenderTime 25ms CodeModel.GetById 10ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 1ms

/security/nss/lib/softoken/lowkeyi.h

http://github.com/zpao/v8monkey
C Header | 108 lines | 26 code | 15 blank | 67 comment | 0 complexity | bab4870b8d2bf28d4491fe496d5570a5 MD5 | raw file
  1/* ***** BEGIN LICENSE BLOCK *****
  2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  3 *
  4 * The contents of this file are subject to the Mozilla Public License Version
  5 * 1.1 (the "License"); you may not use this file except in compliance with
  6 * the License. You may obtain a copy of the License at
  7 * http://www.mozilla.org/MPL/
  8 *
  9 * Software distributed under the License is distributed on an "AS IS" basis,
 10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 11 * for the specific language governing rights and limitations under the
 12 * License.
 13 *
 14 * The Original Code is the Netscape security libraries.
 15 *
 16 * The Initial Developer of the Original Code is
 17 * Netscape Communications Corporation.
 18 * Portions created by the Initial Developer are Copyright (C) 1994-2000
 19 * the Initial Developer. All Rights Reserved.
 20 *
 21 * Contributor(s):
 22 *   Dr Vipul Gupta <vipul.gupta@sun.com>, Sun Microsystems Laboratories
 23 *
 24 * Alternatively, the contents of this file may be used under the terms of
 25 * either the GNU General Public License Version 2 or later (the "GPL"), or
 26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 27 * in which case the provisions of the GPL or the LGPL are applicable instead
 28 * of those above. If you wish to allow use of your version of this file only
 29 * under the terms of either the GPL or the LGPL, and not to allow others to
 30 * use your version of this file under the terms of the MPL, indicate your
 31 * decision by deleting the provisions above and replace them with the notice
 32 * and other provisions required by the GPL or the LGPL. If you do not delete
 33 * the provisions above, a recipient may use your version of this file under
 34 * the terms of any one of the MPL, the GPL or the LGPL.
 35 *
 36 * ***** END LICENSE BLOCK ***** */
 37/* $Id: lowkeyi.h,v 1.11 2007/06/13 00:24:56 rrelyea%redhat.com Exp $ */
 38
 39#ifndef _LOWKEYI_H_
 40#define _LOWKEYI_H_
 41
 42#include "prtypes.h"
 43#include "seccomon.h"
 44#include "secoidt.h"
 45#include "lowkeyti.h"
 46
 47SEC_BEGIN_PROTOS
 48
 49/*
 50 * See bugzilla bug 125359
 51 * Since NSS (via PKCS#11) wants to handle big integers as unsigned ints,
 52 * all of the templates above that en/decode into integers must be converted
 53 * from ASN.1's signed integer type.  This is done by marking either the
 54 * source or destination (encoding or decoding, respectively) type as
 55 * siUnsignedInteger.
 56 */
 57extern void prepare_low_rsa_priv_key_for_asn1(NSSLOWKEYPrivateKey *key);
 58extern void prepare_low_pqg_params_for_asn1(PQGParams *params);
 59extern void prepare_low_dsa_priv_key_for_asn1(NSSLOWKEYPrivateKey *key);
 60extern void prepare_low_dsa_priv_key_export_for_asn1(NSSLOWKEYPrivateKey *key);
 61extern void prepare_low_dh_priv_key_for_asn1(NSSLOWKEYPrivateKey *key);
 62#ifdef NSS_ENABLE_ECC
 63extern void prepare_low_ec_priv_key_for_asn1(NSSLOWKEYPrivateKey *key);
 64extern void prepare_low_ecparams_for_asn1(ECParams *params);
 65#endif /* NSS_ENABLE_ECC */
 66
 67/*
 68** Destroy a private key object.
 69**	"key" the object
 70**	"freeit" if PR_TRUE then free the object as well as its sub-objects
 71*/
 72extern void nsslowkey_DestroyPrivateKey(NSSLOWKEYPrivateKey *key);
 73
 74/*
 75** Destroy a public key object.
 76**	"key" the object
 77**	"freeit" if PR_TRUE then free the object as well as its sub-objects
 78*/
 79extern void nsslowkey_DestroyPublicKey(NSSLOWKEYPublicKey *key);
 80
 81/*
 82** Return the modulus length of "pubKey".
 83*/
 84extern unsigned int nsslowkey_PublicModulusLen(NSSLOWKEYPublicKey *pubKey);
 85
 86
 87/*
 88** Return the modulus length of "privKey".
 89*/
 90extern unsigned int nsslowkey_PrivateModulusLen(NSSLOWKEYPrivateKey *privKey);
 91
 92
 93/*
 94** Convert a low private key "privateKey" into a public low key
 95*/
 96extern NSSLOWKEYPublicKey 
 97		*nsslowkey_ConvertToPublicKey(NSSLOWKEYPrivateKey *privateKey);
 98
 99/* Make a copy of a low private key in it's own arena.
100 * a return of NULL indicates an error.
101 */
102extern NSSLOWKEYPrivateKey *
103nsslowkey_CopyPrivateKey(NSSLOWKEYPrivateKey *privKey);
104
105
106SEC_END_PROTOS
107
108#endif /* _LOWKEYI_H_ */