generateKeyPair :: IO KeyPair
generateKeyPair = withOpenSSL $
      -- Use a large key size / exponent
  let keySize          = 4096
      keyExponent      = 65537

      generateRsaKey   = RSA.generateRSAKey' keySize keyExponent

      -- Extracts public key part out of a private key
      extractPublicKey :: PrivateKey -> IO PublicKey
      extractPublicKey = RSA.rsaCopyPublic

  in do
    privateKey <- D.log "Generating RSA key pair" generateRsaKey
    publicKey  <- extractPublicKey privateKey

    return (KeyPair publicKey privateKey)
generateKeyPair :: IO KeyPair
generateKeyPair = withOpenSSL $
      -- Use a large key size / exponent
  let keySize          = 4096
      keyExponent      = 65537

      generateRsaKey   = RSA.generateRSAKey' keySize keyExponent

      -- Extracts public key part out of a private key
      extractPublicKey :: PrivateKey -> IO PublicKey
      extractPublicKey = RSA.rsaCopyPublic

  in do
    privateKey <- D.log "Generating RSA key pair" generateRsaKey
    publicKey  <- extractPublicKey privateKey

    return (KeyPair publicKey privateKey)
generateKeyPair = withOpenSSL $
      -- Use a large key size / exponent
  let keySize          = 4096
      keyExponent      = 65537

      generateRsaKey   = RSA.generateRSAKey' keySize keyExponent

      -- Extracts public key part out of a private key
      extractPublicKey :: PrivateKey -> IO PublicKey
      extractPublicKey = RSA.rsaCopyPublic

  in do
    privateKey <- D.log "Generating RSA key pair" generateRsaKey
    publicKey  <- extractPublicKey privateKey

    return (KeyPair publicKey privateKey)