catch PyAsn1Error for encoding signature as well