Open whihail opened 8 years ago
用 php 生成的:
<?php
$config = array(
"digest_alg" => "sha512",
"private_key_bits" => 1024,
"private_key_type" => OPENSSL_KEYTYPE_RSA,
);
$res = openssl_pkey_new($config);
$private_key = '';
openssl_pkey_export($res, $private_key);
$details = openssl_pkey_get_details($res);
$public_key = $details["key"];
var_dump($private_key, $public_key);
我的后台语言是java,请问该怎么做?如果也使用pho生成的密钥对有没有问题?
只要生成的密钥(公/私)字符串和php例子里生成的格式一样即可.
我使用php生成的密钥也不能解密成功啊,怎么回事
字符串过长无法加密
请问demo中的密钥对从哪里来呀?为什么我用openssl生成的pem格式的密钥对在此解密不出来,在终端中使用openssl能解密出来?