digitallySignParams :: Context -> Bytes -> SignatureAlgorithm -> IO DigitallySigned
digitallySignParams ctx signatureData sigAlg = do
    usedVersion <- usingState_ ctx getVersion
    let mhash = case usedVersion of
                    TLS12 -> case filter ((==) sigAlg . snd) $ supportedHashSignatures $ ctxSupported ctx of
                                []  -> error ("no hash signature for " ++ show sigAlg)
                                x:_ -> Just (fst x)
                    _     -> Nothing
    let hashDescr = signatureHashData sigAlg mhash
    signatureCreate ctx (fmap (\h -> (h, sigAlg)) mhash) (hashDescr, signatureData)
digitallySignParams :: Context -> Bytes -> SignatureAlgorithm -> IO DigitallySigned
digitallySignParams ctx signatureData sigAlg = do
    usedVersion <- usingState_ ctx getVersion
    let mhash = case usedVersion of
                    TLS12 -> case filter ((==) sigAlg . snd) $ supportedHashSignatures $ ctxSupported ctx of
                                []  -> error ("no hash signature for " ++ show sigAlg)
                                x:_ -> Just (fst x)
                    _     -> Nothing
    let hashDescr = signatureHashData sigAlg mhash
    signatureCreate ctx (fmap (\h -> (h, sigAlg)) mhash) (hashDescr, signatureData)
digitallySignParams ctx signatureData sigAlg = do
    usedVersion <- usingState_ ctx getVersion
    let mhash = case usedVersion of
                    TLS12 -> case filter ((==) sigAlg . snd) $ supportedHashSignatures $ ctxSupported ctx of
                                []  -> error ("no hash signature for " ++ show sigAlg)
                                x:_ -> Just (fst x)
                    _     -> Nothing
    let hashDescr = signatureHashData sigAlg mhash
    signatureCreate ctx (fmap (\h -> (h, sigAlg)) mhash) (hashDescr, signatureData)