// ParsePrivateKey parse private key.
ParsePrivateKey parse private key.
// ParsePrivateKey parse private key .
func ParsePrivateKey(der []byte) (crypto.PrivateKey, error) {
	if key, err := x509.ParsePKCS8PrivateKey(der); err == nil {
		switch key := key.(type) {
		case ed25519.PrivateKey, *ecdsa.PrivateKey:
			return key, nil
		default:
			return nil, fmt.Errorf("found unknown private key type in PKCS#8 wrapping")
		}
	}
	if key, err := x509.ParseECPrivateKey(der); err == nil {
		return key, nil
	}
	return nil, fmt.Errorf("failed to parse private key")
}
func ParsePrivateKey ( der [ ] byte ) ( crypto . PrivateKey , error ) { if key , err := x509 . ParsePKCS8PrivateKey ( der ) ; err == nil { switch key := key . ( type ) { case ed25519 . PrivateKey , * ecdsa . PrivateKey : return key , nil default : return nil , fmt . Errorf ( " " ) } } if key , err := x509 . ParseECPrivateKey ( der ) ; err == nil { return key , nil } return nil , fmt . Errorf ( " " ) }
ParsePrivateKey parse private key.
ParsePrivateKey parse private key .