(issuer_cn, keychain=login_keychain, gui=False,
                                  password=None)
return deleted_certs
Removes all certificates issued from a given CN from the keychain.

  DeleteCert tries to raise privileges to allow deletions from the System
  keychain, so we try and log if it fails.

  Args:
    issuer_cn: str, the certificate's issuer's CN
    keychain: str, the path to the keychain to remove from
    gui: True if running in a gui context
    password: The user's password if already known.

  Raises:
    KeychainError: if there are any errors removing

  Returns:
    Array of deleted serial numbers
Removes all certificates issued from a given CN from the keychain.
Removes all certificates issued from a given CN from the keychain .
def RemoveIssuerCertsFromKeychain(issuer_cn, keychain=login_keychain, gui=False,
                                  password=None):
  """Removes all certificates issued from a given CN from the keychain.

  DeleteCert tries to raise privileges to allow deletions from the System
  keychain, so we try and log if it fails.

  Args:
    issuer_cn: str, the certificate's issuer's CN
    keychain: str, the path to the keychain to remove from
    gui: True if running in a gui context
    password: The user's password if already known.

  Raises:
    KeychainError: if there are any errors removing

  Returns:
    Array of deleted serial numbers
  """
  if keychain is None:
    return []

  existing_certs = FindCertificates(issuer_cn=issuer_cn, keychain=keychain)
  deleted_certs = []
  for cert in existing_certs:
    try:
      logging.debug('Removing cert with fingerprint %s from %s',
                    cert.osx_fingerprint, keychain)
      DeleteCert(cert.osx_fingerprint, keychain=keychain, gui=gui,
                 password=password)
      deleted_certs.append(cert.serial)
    except CertError, e:
      logging.error('Cannot delete old certificate: %s', str(e))
  return deleted_certs
def RemoveIssuerCertsFromKeychain ( issuer_cn , keychain = login_keychain , gui = False , password = None ) : if keychain is None : return [ ] existing_certs = FindCertificates ( issuer_cn = issuer_cn , keychain = keychain ) deleted_certs = [ ] for cert in existing_certs : try : logging . debug ( 'Removing cert with fingerprint %s from %s' , cert . osx_fingerprint , keychain ) DeleteCert ( cert . osx_fingerprint , keychain = keychain , gui = gui , password = password ) deleted_certs . append ( cert . serial ) except CertError , e : logging . error ( 'Cannot delete old certificate: %s' , str ( e ) ) return deleted_certs