TS bugfixes: Do not hardcode message digest algorithms; fix ASN1 decoding. Submitted by: Zoltan Glozik <zglozik@opentsa.org>