def dump_pyopenssl_chain(chain, filetype=OpenSSL.crypto.FILETYPE_PEM):
 def _dump_cert(cert):
  if isinstance(cert, jose.ComparableX509):
   cert = cert.wrapped
  return OpenSSL.crypto.dump_certificate(filetype, cert)
 return ''.join((_dump_cert(cert) for cert in chain))

def dump_pyopenssl_chain ( chain , filetype = OpenSSL . crypto . FILETYPE_PEM ) : def _dump_cert ( cert ) : if isinstance ( cert , jose . ComparableX509 ) : cert = cert . wrapped return OpenSSL . crypto . dump_certificate ( filetype , cert ) return '' . join ( ( _dump_cert ( cert ) for cert in chain ) )
dump certificate chain into a bundle .