Changed memory management and call logic in PKCS#7 parser/generator.