Fixed possible invalid memory access
Calculate actual key length from all key components
Added generic ASN.1 decode function
Fixed DSA signature creation
Added support for loading a private DSA key
Removed debug output