Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
b879882a
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
大约 1 年 前同步成功
通知
9
Star
18
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b879882a
编写于
4月 02, 2016
作者:
R
Richard Levitte
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Document RSA accessors/writers
Reviewed-by:
N
Matt Caswell
<
matt@openssl.org
>
上级
9862e9aa
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
93 addition
and
20 deletion
+93
-20
doc/crypto/RSA_get0_key.pod
doc/crypto/RSA_get0_key.pod
+86
-0
doc/crypto/rsa.pod
doc/crypto/rsa.pod
+7
-20
未找到文件。
doc/crypto/RSA_get0_key.pod
0 → 100644
浏览文件 @
b879882a
=pod
=head1 NAME
RSA_set0_key, RSA_set0_factors, RSA_set0_crt_params, RSA_get0_key,
RSA_get0_factors, RSA_get0_crt_params, RSA_clear_flags,
RSA_test_flags, RSA_set_flags, RSA_get0_engine - Routines for getting
and setting data in an RSA object
=head1 SYNOPSIS
#include <openssl/rsa.h>
int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d);
int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q);
int RSA_set0_crt_params(RSA *r,BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp);
void RSA_get0_key(const RSA *r, BIGNUM **n, BIGNUM **e, BIGNUM **d);
void RSA_get0_factors(const RSA *r, BIGNUM **p, BIGNUM **q);
void RSA_get0_crt_params(const RSA *r,
BIGNUM **dmp1, BIGNUM **dmq1, BIGNUM **iqmp);
void RSA_clear_flags(RSA *r, int flags);
int RSA_test_flags(const RSA *r, int flags);
void RSA_set_flags(RSA *r, int flags);
ENGINE *RSA_get0_engine(RSA *r);
=head1 DESCRIPTION
An RSA object contains the components for the public and private key,
B<n>, B<e>, B<d>, B<p>, B<q>, B<dmp1>, B<dmq1> and B<iqmp>. B<n> is
the modulus common to both public and private key, B<e> is the public
exponent and B<d> is the private exponent. B<p>, B<q>, B<dmp1>,
B<dmq1> and B<iqmp> are the factors for the second representation of a
private key (see PKCS#1 section 3 Key Types), where B<p> and B<q> are
the first and second factor of B<n> and B<dmp1>, B<dmq1> and B<iqmp>
are the exponents and coefficient for CRT calculations.
The B<n>, B<e> and B<d> parameters can be obtained by calling
RSA_get0_key(). If they have not been set yet, then B<*n>, B<*e> and
B<*d> will be set to NULL. Otherwise, they are set to pointers to
their respective values. These point directly to the internal
representations of the values and therefore should not be freed
by the caller.
The B<n>, B<e> and B<d> parameter values can be set by calling
RSA_set0_key() and passing the new values for B<n>, B<e> and B<d> as
parameters to the function. Calling this function transfers the memory
management of the values to the RSA object, and therefore the values
that have been passed in should not be freed by the caller after this
function has been called.
In a similar fashion, the B<p> and B<q> parameters can be obtained and
set with RSA_get0_factors() and RSA_set0_factors(), and the B<dmp1>,
B<dmq1> and B<iqmp> parameters can be obtained and set with
RSA_get0_crt_params() and RSA_set0_crt_params().
RSA_set_flags() sets the flags in the B<flags> parameter on the RSA
object. Multiple flags can be passed in one go (bitwise ORed together).
Any flags that are already set are left set. RSA_test_flags() tests to
see whether the flags passed in the B<flags> parameter are currently
set in the RSA object. Multiple flags can be tested in one go. All
flags that are currently set are returned, or zero if none of the
flags are set. RSA_clear_flags() clears the specified flags within the
RSA object.
RSA_get0_engine() returns a handle to the ENGINE that has been set for
this RSA object, or NULL if no such ENGINE has been set.
=head1 RETURN VALUES
RSA_set0_key(), RSA_set0_factors and RSA_set0_crt_params() return 1 on
success or 0 on failure.
RSA_test_flags() returns the current state of the flags in the RSA object.
RSA_get0_engine() returns the ENGINE set for the RSA object or NULL if no
ENGINE has been set.
=head1 SEE ALSO
L<rsa(3)>, L<RSA_new(3)>, L<RSA_size(3)>
=head1 HISTORY
The functions described here were added in OpenSSL version 1.1.0.
=cut
doc/crypto/rsa.pod
浏览文件 @
b879882a
...
...
@@ -58,25 +58,12 @@ rsa - RSA public key cryptosystem
These functions implement RSA public key encryption and signatures
as defined in PKCS #1 v2.0 [RFC 2437].
The B<RSA> structure consists of several BIGNUM components. It can
contain public as well as private RSA keys:
struct
{
BIGNUM *n; // public modulus
BIGNUM *e; // public exponent
BIGNUM *d; // private exponent
BIGNUM *p; // secret prime factor
BIGNUM *q; // secret prime factor
BIGNUM *dmp1; // d mod (p-1)
BIGNUM *dmq1; // d mod (q-1)
BIGNUM *iqmp; // q^-1 mod p
// ...
};
RSA
In public keys, the private exponent and the related secret values are
B<NULL>.
The B<RSA> structure consists of the BIGNUM components B<n>, B<e>,
B<d>, B<p>, B<q>, B<dmp1>, B<dmq1> and B<iqmp>, which represent public
as well as private RSA keys.
In public keys, the private exponent B<d> and the related secret
values B<p>, B<q>, B<dmp1>, B<dmq1> and B<iqmp> are B<NULL>.
B<p>, B<q>, B<dmp1>, B<dmq1> and B<iqmp> may be B<NULL> in private
keys, but the RSA operations are much faster when these values are
...
...
@@ -101,7 +88,7 @@ RSA was covered by a US patent which expired in September 2000.
=head1 SEE ALSO
L<rsa(1)>, L<bn(3)>, L<dsa(3)>, L<dh(3)>,
L<rand(3)>, L<engine(3)>, L<RSA_new(3)>,
L<rand(3)>, L<engine(3)>, L<RSA_new(3)>,
L<RSA_set0_key(3)>
L<RSA_public_encrypt(3)>,
L<RSA_sign(3)>, L<RSA_size(3)>,
L<RSA_generate_key(3)>,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录