diff options
author | nelsonb%netscape.com <devnull@localhost> | 2001-04-11 00:29:18 +0000 |
---|---|---|
committer | nelsonb%netscape.com <devnull@localhost> | 2001-04-11 00:29:18 +0000 |
commit | 25c2f3f321bcc5e221456df967589947f2f79a44 (patch) | |
tree | 640e11cbf46ec107b8a165257c797785a6b8482b /security/nss/lib/cryptohi | |
parent | 3e5733e964447e5b73dec8be61fb1990d2a6633f (diff) | |
download | nss-hg-25c2f3f321bcc5e221456df967589947f2f79a44.tar.gz |
Implementation of 5 DHE ciphersuites, client side only.
Contributed by Dr Stephen Henson <stephen.henson@gemplus.com>
Diffstat (limited to 'security/nss/lib/cryptohi')
-rw-r--r-- | security/nss/lib/cryptohi/keyhi.h | 11 | ||||
-rw-r--r-- | security/nss/lib/cryptohi/seckey.c | 15 |
2 files changed, 23 insertions, 3 deletions
diff --git a/security/nss/lib/cryptohi/keyhi.h b/security/nss/lib/cryptohi/keyhi.h index 6c1a70546..b0a99698b 100644 --- a/security/nss/lib/cryptohi/keyhi.h +++ b/security/nss/lib/cryptohi/keyhi.h @@ -16,7 +16,8 @@ * Copyright (C) 1994-2000 Netscape Communications Corporation. All * Rights Reserved. * - * Contributor(s): + * Contributor(s): + * Dr Stephen Henson <stephen.henson@gemplus.com> * * Alternatively, the contents of this file may be used under the * terms of the GNU General Public License Version 2 or later (the @@ -99,10 +100,16 @@ extern SECKEYPublicKey *SECKEY_CopyPublicKey(SECKEYPublicKey *pubKey); extern SECKEYPublicKey *SECKEY_ConvertToPublicKey(SECKEYPrivateKey *privateKey); /* - * create a new RSA key pair. The public Key is returned... + * create a new RSA key pair. The private Key is returned... */ SECKEYPrivateKey *SECKEY_CreateRSAPrivateKey(int keySizeInBits, SECKEYPublicKey **pubk, void *cx); + +/* + * create a new DH key pair. The private Key is returned... + */ +SECKEYPrivateKey *SECKEY_CreateDHPrivateKey(DHParams *param, + SECKEYPublicKey **pubk, void *cx); /* ** Create a subject-public-key-info based on a public key. */ diff --git a/security/nss/lib/cryptohi/seckey.c b/security/nss/lib/cryptohi/seckey.c index 76c4b8ef4..4ffa67fd6 100644 --- a/security/nss/lib/cryptohi/seckey.c +++ b/security/nss/lib/cryptohi/seckey.c @@ -16,7 +16,8 @@ * Copyright (C) 1994-2000 Netscape Communications Corporation. All * Rights Reserved. * - * Contributor(s): + * Contributor(s): + * Dr Stephen Henson <stephen.henson@gemplus.com> * * Alternatively, the contents of this file may be used under the * terms of the GNU General Public License Version 2 or later (the @@ -159,6 +160,18 @@ SECKEY_CreateRSAPrivateKey(int keySizeInBits,SECKEYPublicKey **pubk, void *cx) return(privk); } +SECKEYPrivateKey * +SECKEY_CreateDHPrivateKey(DHParams *param, SECKEYPublicKey **pubk, void *cx) +{ + SECKEYPrivateKey *privk; + PK11SlotInfo *slot = PK11_GetBestSlot(CKM_DH_PKCS_KEY_PAIR_GEN,cx); + + privk = PK11_GenerateKeyPair(slot,CKM_DH_PKCS_KEY_PAIR_GEN,param,pubk, + PR_FALSE, PR_TRUE, cx); + PK11_FreeSlot(slot); + return(privk); +} + void SECKEY_DestroyPrivateKey(SECKEYPrivateKey *privk) { |