remove RSA-specific methods on keys.PrivateKey (#43982)

This commit is contained in:
Nic Klaassen
2024-07-10 18:50:39 +00:00
committed by GitHub
parent ed2f1b6025
commit fb8ef40e01
8 changed files with 53 additions and 59 deletions
+3
View File
@@ -37,6 +37,9 @@ import (
// ConvertToPPK takes a regular RSA-formatted keypair and converts it into the PPK file format used by the PuTTY SSH client.
// The file format is described here: https://the.earth.li/~sgtatham/putty/0.76/htmldoc/AppendixC.html#ppk
//
// TODO(nklaassen): support Ed25519 and ECDSA keys. The file format supports it,
// we just don't support writing them here.
func ConvertToPPK(privateKey *rsa.PrivateKey, pub []byte) ([]byte, error) {
// https://the.earth.li/~sgtatham/putty/0.76/htmldoc/AppendixC.html#ppk
// RSA keys are stored using an algorithm-name of 'ssh-rsa'. (Keys stored like this are also used by the updated RSA signature schemes that use