So I am having a hard time finding how to simply import an RSA public key from a string in Go.
My program should do the following:
- Receives a public key encoded in base64 (that works)
- Decode this public key from base64 to bytes (that works)
- Import that public key so that it is usable by the RSA implementation of Go (Problem is at this stage)
- Encrypt an AES key with this
rsa.EncryptOAEP(sha256.New(), rand.Reader, publicKey, plaintextBytes, byte(""))