如何使用RSA和aes-256-gcm生成密钥?

时间:2016-03-14 09:49:00

标签: openssl

我想用RSA和AES 256 GCM生成密钥,但每次都会出现以下错误:

$ openssl genpkey -out mkey.pem -aes-256-gcm -algorithm rsa
.........................++++++
..............++++++
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
Error writing key
140735190483024:error:0D0A7072:asn1 encoding routines:PKCS5_pbe2_set_iv:error setting cipher params:p5_pbev2.c:133:
140735190483024:error:2307D00D:PKCS12 routines:PKCS8_encrypt:ASN1 lib:p12_p8e.c:86:

OpenSSL版本OpenSSL 1.0.2g 1 Mar 2016。 Max OS X 10.11。

当我尝试使用aes-256-ctr时,我也会收到错误但略有不同:

openssl genpkey -out mkey.pem -aes-256-ctr -algorithm rsa
.................++++++
.....++++++
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
Error writing key
140735190483024:error:0D0A706C:asn1 encoding routines:PKCS5_pbe2_set_iv:cipher has no object identifier:p5_pbev2.c:104:
140735190483024:error:2307D00D:PKCS12 routines:PKCS8_encrypt:ASN1 lib:p12_p8e.c:86:

0 个答案:

没有答案