getHashAndASN1 :: MonadIO m => (HashAlgorithm, SignatureAlgorithm) -> m Hash
getHashAndASN1 hashSig = case hashSig of
    (HashSHA1,   SignatureRSA) -> return SHA1
    (HashSHA224, SignatureRSA) -> return SHA224
    (HashSHA256, SignatureRSA) -> return SHA256
    (HashSHA384, SignatureRSA) -> return SHA384
    (HashSHA512, SignatureRSA) -> return SHA512
    _                          -> throwCore $ Error_Misc "unsupported hash/sig algorithm"
getHashAndASN1 :: MonadIO m => (HashAlgorithm, SignatureAlgorithm) -> m Hash
getHashAndASN1 hashSig = case hashSig of
    (HashSHA1,   SignatureRSA) -> return SHA1
    (HashSHA224, SignatureRSA) -> return SHA224
    (HashSHA256, SignatureRSA) -> return SHA256
    (HashSHA384, SignatureRSA) -> return SHA384
    (HashSHA512, SignatureRSA) -> return SHA512
    _                          -> throwCore $ Error_Misc "unsupported hash/sig algorithm"
getHashAndASN1 hashSig = case hashSig of
    (HashSHA1,   SignatureRSA) -> return SHA1
    (HashSHA224, SignatureRSA) -> return SHA224
    (HashSHA256, SignatureRSA) -> return SHA256
    (HashSHA384, SignatureRSA) -> return SHA384
    (HashSHA512, SignatureRSA) -> return SHA512
    _                          -> throwCore $ Error_Misc "unsupported hash/sig algorithm"