'Use openssl program to confirm three components are recoverable from a
PKCS12 string.'

def check_recovery(self, p12_str, key=None, cert=None, ca=None, passwd='', extra=()):

    if key:
        recovered_key = _runopenssl(p12_str, 'pkcs12', '-nocerts', '-nodes', '-passin', ('pass:' + passwd), *extra)
        self.assertEqual(recovered_key[(- len(key)):], key)
    if cert:
        recovered_cert = _runopenssl(p12_str, 'pkcs12', '-clcerts', '-nodes', '-passin', ('pass:' + passwd), '-nokeys', *extra)
        self.assertEqual(recovered_cert[(- len(cert)):], cert)
    if ca:
        recovered_cert = _runopenssl(p12_str, 'pkcs12', '-cacerts', '-nodes', '-passin', ('pass:' + passwd), '-nokeys', *extra)
        self.assertEqual(recovered_cert[(- len(ca)):], ca)
