
有沒有辦法在執行 openssl 1.0 的伺服器上產生可由使用 openssl 0.9 的客戶端讀取的金鑰?
- 客戶端正在使用 php_openssl (OpenSSL 函式庫版本 => OpenSSL 0.9.8o)
伺服器正在使用 php_openssl(OpenSSL 函式庫版本 => OpenSSL 1.0.1e 2013 年 2 月 11 日)
使用 openssl 1.0 產生的密鑰的形式為“-----BEGIN PRIVATE KEY-----”,其中包含 algo(我猜)
- 使用 openssl 0.9 產生的金鑰格式為
-----BEGIN RSA PRIVATE KEY-----
我的腳本剝離伺服器上的 ASCII 裝甲,然後將其放回客戶端,因此我在 1.0 密鑰上寫入 0.9 裝甲( RSA ),這會導緻密鑰無效。
是否有一個選項可以在 openssl 1.0 上產生 0.9 格式的密鑰(密鑰類型在裝甲中,而不是在身體中)?
答案1
如上所述https://superuser.com/questions/606215/openssl-pkcs8-default-format-gives-rsa-private-key,您可以使用 openssl 1.0 產生的金鑰「轉換」為 0.98 相容的金鑰
openssl rsa -in file.pem -text > key.pem