My goal is to generate a keypair using generateKeyPair from Codec.Crypto.RSA.
This function requires a generator of type RandomGen. I have tried to make this generator with newGenIO, but I'm having a hard time specifying its type.
import qualified Codec.Crypto.RSA as Crypto
import Crypto.Random
someFunc = do
let g = newGenIO :: CryptoRandomGen (IO SystemRandom)
let keyPair = Crypto.generateKeyPair g 10
Haskell suggested CryptoRandomGen SystemRandom when I didn't specify a type after newGenIO.
This is the error message that comes when trying to run the code.
• Expected a type, but
‘CryptoRandomGen (IO SystemRandom)’ has kind
‘Constraint’
Does anyone know what type I have use to get it to work?