package crypto

import (
	
	
	

	
)

// ParseRSAPublicKeys parses data as list of PEM-encdoed public keys.
func ( []byte) ([]*rsa.PublicKey, error) {
	var  []*rsa.PublicKey

	for {
		,  := pem.Decode()
		if  == nil {
			break
		}

		,  := ParseRSA(.Bytes)
		if  != nil {
			return nil, errors.Wrap(, "parse RSA from PEM")
		}

		 = append(, )
		 = 
	}

	return , nil
}

// ParseRSA parses data RSA key in PKCS1 or PKIX forms.
func ( []byte) (*rsa.PublicKey, error) {
	,  := x509.ParsePKCS1PublicKey()
	if  == nil {
		return , nil
	}
	,  := x509.ParsePKIXPublicKey()
	if  != nil {
		return nil, 
	}
	,  := .(*rsa.PublicKey)
	if ! {
		return nil, errors.Errorf("parsed unexpected key type %T", )
	}
	return , nil
}