Beispiel #1
0
 def add_pkcs7_data(self, message):
   p = PKCS7_data()
   p.certificates = [CertificateManager.get_certificate_from_der(c.get_der_data())\
                     for c in message.certificate_data]
   message.pkcs7_data = p
Beispiel #2
0
and -c) is needed!\n" % login_method)
        sys.exit(101)
    if login_method in ("username", "user_certificate", "hotp", "totp"):
      # username and password login
      # try to find a stored password
      passfile = "./.isds_password"
      if os.path.exists(passfile):
        print "Using password from '%s'" % passfile
        password = file(passfile,'r').read().strip()
      else:
        import getpass
        password = getpass.getpass("Enter login password:"******"hotp", "totp"):
        args.update(otp_callback=otp_callback)
    CertificateManager.read_trusted_certificates_from_dir("trusted_certificates")
    # create the client      
    ds_client = Client(**args)
    # run the tests
    for test in to_run:
      print "==================== %s ====================" % test.__name__
      # if testing password change, pass current password      
      test()
      print "==================== end of %s ====================" % test.__name__  
      print
      print
    ds_client.logout_from_server()
  else:
    list_tests(tests)
    print op.get_usage()