(ctx context.Context, path string)
| 20 | ) |
| 21 | |
| 22 | func ReadPrivateKey(ctx context.Context, path string) (ssh.Signer, error) { |
| 23 | privateKeyContent, err := os.ReadFile(path) |
| 24 | if err != nil { |
| 25 | return nil, errors.Wrapf(ctx, err, "read private key file %s", path) |
| 26 | } |
| 27 | return readPrivateKeyWithContent(ctx, path, privateKeyContent) |
| 28 | } |
| 29 | |
| 30 | func readPrivateKeyWithContent(ctx context.Context, path string, privateKeyContent []byte) (ssh.Signer, error) { |
| 31 | // We parse the private key on our own first so that we can |
no test coverage detected