def check_recovery(self, p12_str, key=None, cert=None, ca=None, passwd=b"<STR_LIT>",<EOL>extra=()):
if key:<EOL><INDENT>recovered_key = _runopenssl(<EOL>p12_str, b"<STR_LIT>", b"<STR_LIT>", b"<STR_LIT>", b"<STR_LIT>",<EOL>b"<STR_LIT>" + passwd, *extra)<EOL>assert recovered_key[-len(key):] == key<EOL><DEDENT>if cert:<EOL><INDENT>recovered_cert = _runopenssl(<EOL>p12_str, b"<STR_LIT>", b"<STR_LIT>", b"<STR_LIT>", b"<STR_LIT>",<EOL>b"<STR_LIT>" + passwd, b"<STR_LIT>", *extra)<EOL>assert recovered_cert[-len(cert):] == cert<EOL><DEDENT>if ca:<EOL><INDENT>recovered_cert = _runopenssl(<EOL>p12_str, b"<STR_LIT>", b"<STR_LIT>", b"<STR_LIT>", b"<STR_LIT>",<EOL>b"<STR_LIT>" + passwd, b"<STR_LIT>", *extra)<EOL>assert recovered_cert[-len(ca):] == ca<EOL><DEDENT>
Use openssl program to confirm three components are recoverable from a
PKCS12 string.