CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions
authentication.X509CertAuth Class Reference
Inheritance diagram for authentication.X509CertAuth:

Public Member Functions

def __init__
 

Detailed Description

Class to authenticate via Grid Certificate

Definition at line 26 of file authentication.py.

Constructor & Destructor Documentation

def authentication.X509CertAuth.__init__ (   self,
  host,
  args,
  kwargs 
)

Definition at line 28 of file authentication.py.

References beamvalidation.exit(), and print().

28 
29  def __init__(self, host, *args, **kwargs):
30  key_file = None
31  cert_file = None
32 
33  x509_path = getenv("X509_USER_PROXY", None)
34  if x509_path and exists(x509_path):
35  key_file = cert_file = x509_path
36 
37  if not key_file:
38  x509_path = getenv("X509_USER_KEY", None)
39  if x509_path and exists(x509_path):
40  key_file = x509_path
41 
42  if not cert_file:
43  x509_path = getenv("X509_USER_CERT", None)
44  if x509_path and exists(x509_path):
45  cert_file = x509_path
46 
47  if not key_file:
48  x509_path = getenv("HOME") + "/.globus/userkey.pem"
49  if exists(x509_path):
50  key_file = x509_path
51 
52  if not cert_file:
53  x509_path = getenv("HOME") + "/.globus/usercert.pem"
54  if exists(x509_path):
55  cert_file = x509_path
56 
57  if not key_file or not exists(key_file):
58  print("No certificate private key file found", file=stderr)
59  exit(1)
60 
61  if not cert_file or not exists(cert_file):
62  print("No certificate public key file found", file=stderr)
63  exit(1)
64 
65  #print "Using SSL private key", key_file
66  #print "Using SSL public key", cert_file
67 
68  HTTPSConnection.__init__(self,
69  host,
70  key_file = key_file,
71  cert_file = cert_file,
72  **kwargs)
73 
74 #-----------------------------------------------------------------------------
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47