code: func PEMtoPublicKey(raw []byte, pwd []byte) (interface{}, error) {
  	if len(raw) == 0 {
  		return nil, errors.New("Invalid PEM. It must be different from nil.")
  	}
  	block, _ := pem.Decode(raw)
  	if block == nil {
  		return nil, fmt.Errorf("Failed decoding. Block must be different from nil. [% x]", raw)
  	}
  
  	// TODO: derive from header the type of the key
  	if x509.IsEncryptedPEMBlock(block) {
  		if len(pwd) == 0 {
  			return nil, errors.New("Encrypted Key. Password must be different from nil")
  		}
  
  		decrypted, err := x509.DecryptPEMBlock(block, pwd)
  		if err != nil {
  			return nil, fmt.Errorf("Failed PEM decryption. [%s]", err)
  		}
  
  		key, err := DERToPublicKey(decrypted)
  		if err != nil {
  			return nil, err
  		}
  		return key, err
  	}
  
  	cert, err := DERToPublicKey(block.Bytes)
  	if err != nil {
  		return nil, err
  	}
  	return cert, err
  }
docs: // PEMtoPublicKey unmarshals a pem to public key