(public *rsa.PublicKey)
| 486 | } |
| 487 | |
| 488 | func EncodePublicKey(public *rsa.PublicKey) ([]byte, error) { |
| 489 | publicBytes, err := x509.MarshalPKIXPublicKey(public) |
| 490 | if err != nil { |
| 491 | return nil, err |
| 492 | } |
| 493 | return pem.EncodeToMemory(&pem.Block{ |
| 494 | Bytes: publicBytes, |
| 495 | Type: "PUBLIC KEY", |
| 496 | }), nil |
| 497 | } |
| 498 | |
| 499 | func EncodeSSHKey(public *rsa.PublicKey) ([]byte, error) { |
| 500 | publicKey, err := ssh.NewPublicKey(public) |
no outgoing calls