// PublicKeyFromPEM public key from pem.
PublicKeyFromPEM public key from pem.
// PublicKeyFromPEM public key from pem .
func PublicKeyFromPEM(pubKeyPEM []byte) (crypto.PublicKey, error) {
	block, _ := pem.Decode(pubKeyPEM)
	if block == nil {
		return nil, fmt.Errorf("public key not found in PEM")
	}
	key, err := x509.ParsePKIXPublicKey(block.Bytes)
	if err != nil {
		return nil, err
	}
	publicKey, ok := key.(crypto.PublicKey)
	if !ok {
		return nil, fmt.Errorf("invalid public key")
	}
	return publicKey, nil
}
func PublicKeyFromPEM ( pubKeyPEM [ ] byte ) ( crypto . PublicKey , error ) { block , _ := pem . Decode ( pubKeyPEM ) if block == nil { return nil , fmt . Errorf ( " " ) } key , err := x509 . ParsePKIXPublicKey ( block . Bytes ) if err != nil { return nil , err } publicKey , ok := key . ( crypto . PublicKey ) if ! ok { return nil , fmt . Errorf ( " " ) } return publicKey , nil }
PublicKeyFromPEM public key from pem.
PublicKeyFromPEM public key from pem .