func RSAPublicKeyFromKey(key *encryption.RSAPublicKey) KeyWithType {
	return KeyWithType{
		Type: RSAPubKey,
		Key:  key,
	}
}
RSAPublicKeyFromKey returns a new KeyWithType that wraps the provided RSAPublicKey.
package encryptedconfigvalue
import (
	"github.com/palantir/go-encrypted-config-value/encryption"
)
func NewRSAKeys(keySizeBits int) (pubKey KeyWithType, privKey KeyWithType, err error) {
	pub, priv, err := encryption.NewRSAKeyPair(keySizeBits)
	if err != nil {
		return KeyWithType{}, KeyWithType{}, err
	}
	return KeyWithType{
			Type: RSAPubKey,
			Key:  pub,
		}, KeyWithType{
			Type: RSAPrivKey,
			Key:  priv,
		}, nil
}
func RSAPublicKeyFromBytes(key []byte) (KeyWithType, error) {
	rsaPubKey, err := encryption.RSAPublicKeyFromPEMBytes(key)
	if err != nil {
		return KeyWithType{}, err
	}
	return RSAPublicKeyFromKey(rsaPubKey), nil
}