summaryrefslogtreecommitdiffstats
path: root/crypto/evp/p_lib.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>1999-10-25 02:00:09 +0000
committerDr. Stephen Henson <steve@openssl.org>1999-10-25 02:00:09 +0000
commitf769ce3ea41ba1c2b16f345722ed006861d51150 (patch)
tree5df2c631989beff5b5b28f01cc09c6c12e44ce02 /crypto/evp/p_lib.c
parent042a93e443732418df4714d217ccc0b35cdc4eb5 (diff)
More multibyte character support.
Functions to get keys from EVP_PKEY structures.
Diffstat (limited to 'crypto/evp/p_lib.c')
-rw-r--r--crypto/evp/p_lib.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c
index 3422b77de6..dba08525a3 100644
--- a/crypto/evp/p_lib.c
+++ b/crypto/evp/p_lib.c
@@ -205,6 +205,42 @@ int EVP_PKEY_assign(EVP_PKEY *pkey, int type, char *key)
return(1);
}
+#ifndef NO_RSA
+RSA *EVP_PKEY_get_RSA(EVP_PKEY *pkey)
+ {
+ if(pkey->type != EVP_PKEY_RSA) {
+ EVPerr(EVP_F_EVP_PKEY_GET_RSA, EVP_R_EXPECTING_AN_RSA_KEY);
+ return NULL;
+ }
+ CRYPTO_add(&pkey->pkey.rsa->references, 1, CRYPTO_LOCK_RSA);
+ return pkey->pkey.rsa;
+}
+#endif
+
+#ifndef NO_DSA
+DSA *EVP_PKEY_get_DSA(EVP_PKEY *pkey)
+ {
+ if(pkey->type != EVP_PKEY_DSA) {
+ EVPerr(EVP_F_EVP_PKEY_GET_DSA, EVP_R_EXPECTING_A_DSA_KEY);
+ return NULL;
+ }
+ CRYPTO_add(&pkey->pkey.rsa->references, 1, CRYPTO_LOCK_DSA);
+ return pkey->pkey.dsa;
+}
+#endif
+
+#ifndef NO_DH
+DH *EVP_PKEY_get_DH(EVP_PKEY *pkey)
+ {
+ if(pkey->type != EVP_PKEY_DH) {
+ EVPerr(EVP_F_EVP_PKEY_GET_DH, EVP_R_EXPECTING_A_DH_KEY);
+ return NULL;
+ }
+ CRYPTO_add(&pkey->pkey.dh->references, 1, CRYPTO_LOCK_DH);
+ return pkey->pkey.dh;
+}
+#endif
+
int EVP_PKEY_type(int type)
{
switch (type)