提交 97458daa 编写于 作者: F FdaSilvaYY

Add X509_REQ_get0_pubkey method

Reviewed-by: NStephen Henson <steve@openssl.org>
Reviewed-by: NRich Salz <rsalz@openssl.org>
上级 0517538d
...@@ -115,6 +115,13 @@ EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req) ...@@ -115,6 +115,13 @@ EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req)
return (X509_PUBKEY_get(req->req_info.pubkey)); return (X509_PUBKEY_get(req->req_info.pubkey));
} }
EVP_PKEY *X509_REQ_get0_pubkey(X509_REQ *req)
{
if (req == NULL)
return NULL;
return (X509_PUBKEY_get0(req->req_info.pubkey));
}
X509_PUBKEY *X509_REQ_get_X509_PUBKEY(X509_REQ *req) X509_PUBKEY *X509_REQ_get_X509_PUBKEY(X509_REQ *req)
{ {
return req->req_info.pubkey; return req->req_info.pubkey;
......
...@@ -3,8 +3,9 @@ ...@@ -3,8 +3,9 @@
=head1 NAME =head1 NAME
X509_get_pubkey, X509_get0_pubkey, X509_set_pubkey, X509_get_X509_PUBKEY, X509_get_pubkey, X509_get0_pubkey, X509_set_pubkey, X509_get_X509_PUBKEY,
X509_REQ_get_pubkey, X509_REQ_set_pubkey, X509_REQ_get_X509_PUBKEY - get or X509_REQ_get_pubkey, X509_REQ_get0_pubkey, X509_REQ_set_pubkey,
set certificate or certificate request public key. X509_REQ_get_X509_PUBKEY - get or set certificate or certificate request
public key.
=head1 SYNOPSIS =head1 SYNOPSIS
...@@ -16,6 +17,7 @@ set certificate or certificate request public key. ...@@ -16,6 +17,7 @@ set certificate or certificate request public key.
X509_PUBKEY *X509_get_X509_PUBKEY(X509 *x); X509_PUBKEY *X509_get_X509_PUBKEY(X509 *x);
EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req); EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req);
EVP_PKEY *X509_REQ_get0_pubkey(X509_REQ *req);
int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey); int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey);
X509_PUBKEY *X509_REQ_get_X509_PUBKEY(X509_REQ *x); X509_PUBKEY *X509_REQ_get_X509_PUBKEY(X509_REQ *x);
...@@ -35,8 +37,8 @@ must not be freed up after use. ...@@ -35,8 +37,8 @@ must not be freed up after use.
X509_set_pubkey() attempts to set the public key for certificate B<x> to X509_set_pubkey() attempts to set the public key for certificate B<x> to
B<pkey>. The key B<pkey> should be freed up after use. B<pkey>. The key B<pkey> should be freed up after use.
X509_REQ_get_pubkey(), X509_REQ_set_pubkey() and X509_REQ_get_X509_PUBKEY() X509_REQ_get_pubkey(), X509_REQ_get0_pubkey(), X509_REQ_set_pubkey() and
are similar but operate on certificate request B<req>. X509_REQ_get_X509_PUBKEY() are similar but operate on certificate request B<req>.
=head1 NOTES =head1 NOTES
...@@ -51,7 +53,7 @@ X509_get_pubkey(), X509_get0_pubkey(), X509_get_X509_PUBKEY(), ...@@ -51,7 +53,7 @@ X509_get_pubkey(), X509_get0_pubkey(), X509_get_X509_PUBKEY(),
X509_REQ_get_pubkey() and X509_REQ_get_X509_PUBKEY() return a public key or X509_REQ_get_pubkey() and X509_REQ_get_X509_PUBKEY() return a public key or
B<NULL> if an error occurred. B<NULL> if an error occurred.
X509_set_pubkey() and X509_REQ_set_pubkey() rerturn 1 for success and 0 X509_set_pubkey() and X509_REQ_set_pubkey() return 1 for success and 0
for failure. for failure.
=head1 SEE ALSO =head1 SEE ALSO
......
...@@ -696,6 +696,7 @@ int X509_REQ_get_signature_nid(const X509_REQ *req); ...@@ -696,6 +696,7 @@ int X509_REQ_get_signature_nid(const X509_REQ *req);
int i2d_re_X509_REQ_tbs(X509_REQ *req, unsigned char **pp); int i2d_re_X509_REQ_tbs(X509_REQ *req, unsigned char **pp);
int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey); int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey);
EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req); EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req);
EVP_PKEY *X509_REQ_get0_pubkey(X509_REQ *req);
X509_PUBKEY *X509_REQ_get_X509_PUBKEY(X509_REQ *req); X509_PUBKEY *X509_REQ_get_X509_PUBKEY(X509_REQ *req);
int X509_REQ_extension_nid(int nid); int X509_REQ_extension_nid(int nid);
int *X509_REQ_get_extension_nids(void); int *X509_REQ_get_extension_nids(void);
......
...@@ -4124,3 +4124,4 @@ DSA_meth_get_sign_setup 3989 1_1_0 EXIST::FUNCTION:DSA ...@@ -4124,3 +4124,4 @@ DSA_meth_get_sign_setup 3989 1_1_0 EXIST::FUNCTION:DSA
DSA_get0_engine 3990 1_1_0 EXIST::FUNCTION:DSA DSA_get0_engine 3990 1_1_0 EXIST::FUNCTION:DSA
X509_VERIFY_PARAM_set_auth_level 3991 1_1_0 EXIST::FUNCTION: X509_VERIFY_PARAM_set_auth_level 3991 1_1_0 EXIST::FUNCTION:
X509_VERIFY_PARAM_get_auth_level 3992 1_1_0 EXIST::FUNCTION: X509_VERIFY_PARAM_get_auth_level 3992 1_1_0 EXIST::FUNCTION:
X509_REQ_get0_pubkey 3993 1_1_0 EXIST::FUNCTION:
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册