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

Class CertificateRepository


Method Summary
  __init__(self, repoDir, create)
Create the repository.
  CreateCertificateRequest(self, nameEntries, passphraseCB, keyType, bits, messageDigest, extensions)
Create a new certificate request and store it in the repository.
  FindCertificateRequests(self, pred)
Return a list of certificate requests for which pred(req) returns true.
  FindCertificateRequestsWithMetadata(self, mdkey, mdvalue)
  FindCertificateRequestsWithSubject(self, subj)
  FindCertificates(self, pred)
Return a list of certificates for which pred(cert) returns true.
  FindCertificatesWithIssuer(self, issuer)
  FindCertificatesWithMetadata(self, mdkey, mdvalue)
  FindCertificatesWithSubject(self, subj)
  GetAllCertificateRequests(self)
  GetAllCertificates(self)
  GetMetadata(self, key)
  GetPrivatekeyMetadata(self, modulus, key)
  ImportCertificatePEM(self, certFile, keyFile, passphraseCB)
Import a PEM-formatted certificate from certFile.
  ImportCertificateX509(self, certobj, pkey, passphraseCB)
Import a PEM-formatted certificate from OpenSSL X509 data structure cert, optional PKey data structre in pkey.
  ImportRequestedCertificate(self, certFile, passphraseCB)
Import a certificate that we earlier issued a request for.
  RemoveCertificate(self, cert)
Remove the specificed certificate from the repository.
  RemoveCertificateRequest(self, req)
Remove the specificed certificate request from the repository.
  SetMetadata(self, key, value)
  SetPrivatekeyMetadata(self, modulus, key, value)
  _GetCertDirPath(self, cert)
Compute the path name for the directory the cert will use
  _GetCertificateRequests(self)
This is a generator function that will walk through all of the certificates we have.
  _GetCertificates(self)
This is a generator function that will walk through all of the certificates we have.
  _GetPrivateKeyPath(self, hash)
  _ImportCertificate(self, cert, path)
Import a certificate.
  _ImportCertificateRequest(self, req)
Import the given certificate request into the repository.
  _ImportPrivateKey(self, pkey, passwdCB)
Import the given private key into the repository.

Class Variable Summary
int KEYTYPE_DSA = 116                                                                   
int KEYTYPE_RSA = 6                                                                     
list validNameComponents = ['cn', 'c', 'l', 'st', 'o', 'ou', ...

Method Details

__init__(self, repoDir, create=0)
(Constructor)

Create the repository.

dir - directory in which to store certificates.

CreateCertificateRequest(self, nameEntries, passphraseCB, keyType=6, bits=1024, messageDigest='md5', extensions=None)

Create a new certificate request and store it in the repository. Returns a CertificateRequestDescriptor for that request.

nameEntries is a list of pairs (key, value) where key is a standard distinguished name key, and value is the value to be used for that key.

extensions is a list of triples (name, critical, value) to be used to set the requests extensions. If passed in as none, a useful default set of extensions will be used.

FindCertificateRequests(self, pred)

Return a list of certificate requests for which pred(req) returns true.

FindCertificates(self, pred)

Return a list of certificates for which pred(cert) returns true.

ImportCertificatePEM(self, certFile, keyFile=None, passphraseCB=None)

Import a PEM-formatted certificate from certFile.

If keyFile is not None, load it as a private key for cert.

We don't currently inspect the key itself to ensure it matches the certificate, as that may require a passphrase.

ImportCertificateX509(self, certobj, pkey=None, passphraseCB=None)

Import a PEM-formatted certificate from OpenSSL X509 data structure cert, optional PKey data structre in pkey.

ImportRequestedCertificate(self, certFile, passphraseCB=None)

Import a certificate that we earlier issued a request for.

RemoveCertificate(self, cert)

Remove the specificed certificate from the repository.

RemoveCertificateRequest(self, req)

Remove the specificed certificate request from the repository.

_GetCertDirPath(self, cert)

Compute the path name for the directory the cert will use

_GetCertificateRequests(self)

This is a generator function that will walk through all of the certificates we have.

_GetCertificates(self)

This is a generator function that will walk through all of the certificates we have.

_ImportCertificate(self, cert, path)

Import a certificate. We've already done the due diligence that this is a valid cert that is okay to just copy into place.

_ImportCertificateRequest(self, req)

Import the given certificate request into the repository.

req is an OpenSSL_AG.crypto.X509Req object.

The pathname of the imported request will be <repo_root>/requests/<modulus_hash>.pem.

_ImportPrivateKey(self, pkey, passwdCB)

Import the given private key into the repository.

passwdCB is passed to the underlying pyOpenSSL routine if it is present and not None. It can be either a string, in which case it represents the passphrase, or a python callable object, in which case it will be invoked by the underlying pyOpenSSL code to retrieve the desired passphrase.


Class Variable Details

KEYTYPE_DSA

Type:
int
Value:
116                                                                   

KEYTYPE_RSA

Type:
int
Value:
6                                                                     

validNameComponents

Type:
list
Value:
['cn', 'c', 'l', 'st', 'o', 'ou', 'emailaddress']                      

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