self.private_key_file = os.path.join(ca.basedir, 'private',
'%s.key' % name)
+ def exists(self):
+ return os.path.exists(self.public_key_file)
+
def get_fingerprint(self, digest='sha1'):
- if os.path.exists(self.public_key_file):
+ if self.exists():
output = openssl_wrap.run('x509', '-in', self.public_key_file,
'-noout', '-fingerprint', '-%s' % digest)
m = re.search(r'=(.*)$', output)
return None
def get_expiration_date(self):
- if os.path.exists(self.public_key_file):
+ if self.exists():
output = openssl_wrap.run('x509', '-in', self.public_key_file,
'-noout', '-dates')
m = re.search(r'notAfter=(.*)', output)