Package AccessGrid :: Package Security :: Module CertificateRepository :: Class Certificate
[show private | hide private]
[frames | no frames]

Class Certificate


Method Summary
  __init__(self, path, keyPath, repo, certHandle, certText)
Create a certificate object.
  GetFilePath(self, filename)
  GetFingerprint(self)
Returns a tuple (type, fingerprint)
  GetIssuer(self)
  GetIssuerSerialHash(self)
  GetKeyPath(self)
  GetMetadata(self, key)
  GetModulus(self)
  GetModulusHash(self)
  GetNotValidAfter(self)
Return notafter time as seconds since the epoch
  GetNotValidAfterText(self)
Return notafter time as a text string in the local timezone.
  GetNotValidBefore(self)
Return notbefore time as seconds since the epoch
  GetNotValidBeforeText(self)
Return notbefore time as a text string in the local timezone.
  GetPath(self)
  GetSerialNumber(self)
  GetShortSubject(self)
  GetSubject(self)
  GetSubjectHash(self)
  GetVerboseHtml(self)
  GetVerboseText(self)
  GetVersion(self)
  IsExpired(self)
  IsGlobusProxy(self)
  IsHostCert(self)
A host cert has a CN of the form "hostname".
  IsServiceCert(self)
A service cert has a CN of the form servicename/hostname.
  SetMetadata(self, key, value)
  WriteCertificate(self, file)
Write the certificate to the given file.
  _GetMetadataKey(self, key)

Class Variable Summary
SRE_Pattern hostCertRE = ^[^\s\./]+(\.[^\s\./]+)+$
SRE_Pattern serviceCertRE = ^([^/]*)/([^/]*)$

Method Details

__init__(self, path, keyPath=None, repo=None, certHandle=None, certText=None)
(Constructor)

Create a certificate object.

This wraps an underlying OpenSSL X.509 cert object.
Parameters:
path - pathname of the stored certificate.
keyPath - pathname of the private key for the certificate
repo - certificate repository to be used as a reference for lookup operations.
certHandle - a file handle to use for loading the certificate. If this is specified, path must be None.
certText - Actual text of the certificate. Again, if specified, path must be None.

GetFingerprint(self)

Returns a tuple (type, fingerprint)

GetNotValidAfter(self)

Return notafter time as seconds since the epoch

GetNotValidAfterText(self)

Return notafter time as a text string in the local timezone.

GetNotValidBefore(self)

Return notbefore time as seconds since the epoch

GetNotValidBeforeText(self)

Return notbefore time as a text string in the local timezone.

IsHostCert(self)

A host cert has a CN of the form "hostname".
Returns:
If a service cert, hostname. Otherwise, None.

IsServiceCert(self)

A service cert has a CN of the form servicename/hostname.
Returns:
If a service cert, (servicename, hostname). Otherwise, None.

WriteCertificate(self, file)

Write the certificate to the given file.

Class Variable Details

hostCertRE

Type:
SRE_Pattern
Value:
^[^\s\./]+(\.[^\s\./]+)+$                                              

serviceCertRE

Type:
SRE_Pattern
Value:
^([^/]*)/([^/]*)$                                                      

Generated by Epydoc 2.1 on Thu Apr 14 16:39:31 2005 http://epydoc.sf.net