// ReadPrivateKey reads the provided private SSH key file and returns the
// corresponding bytes.
ReadPrivateKey reads the provided private SSH key file and returns the
corresponding bytes.
// ReadPrivateKey reads the provided private SSH key file and returns the // corresponding bytes .
func ReadPrivateKey(privateKeyPath string) ([]byte, error) {
	privateKeyPath, err := path.Expand(privateKeyPath)
	if err != nil {
		return nil, errors.Wrapf(err, "failed to expand path to private key \"%s\"", privateKeyPath)
	}
	privateKey, err := ioutil.ReadFile(privateKeyPath)
	if err != nil {
		return nil, errors.Wrapf(err, "failed to read private key \"%s\"", privateKeyPath)
	}
	return privateKey, nil
}
func ReadPrivateKey ( privateKeyPath string ) ( [ ] byte , error ) { privateKeyPath , err := path . Expand ( privateKeyPath ) if err != nil { return nil , errors . Wrapf ( err , " \" \" " , privateKeyPath ) } privateKey , err := ioutil . ReadFile ( privateKeyPath ) if err != nil { return nil , errors . Wrapf ( err , " \" \" " , privateKeyPath ) } return privateKey , nil }
ReadPrivateKey reads the provided private SSH key file and returns the
corresponding bytes.
ReadPrivateKey reads the provided private SSH key file and returns the corresponding bytes .