(subject=None, subject_cn=None, issuer=None, issuer_cn=None,
                     startdate=None, enddate=None, certhash=None,
                     fingerprint=None, email=None, keychain=None)
return matchedcerts
Finds certificates by attribute.

  Multiple attributes are ANDed together.

  To do this, we get a list of all matching certs with a list comprehension,
  then run a reduce multiplying all results. Since bools multiply as ints, a
  False means multiply by 0 so any False match makes the whole thing False.

  Args:
    subject: str, find certificate by full subject
    subject_cn: str, find certificate by subject CN
    issuer: str, find certificate by issuer
    issuer_cn: str, find certificate by issuer CN
    startdate: str, find certificate by notBefore date
    enddate: str, find certificate by notAfter date
    certhash: str, find certificate by SHA-1 hash of suject name
    fingerprint: str, find certificate by fingerprint
    email: str, find certificates by email address
    keychain: str, which keychain to look in
  Returns:
    List of matching Certificate objects
  Raises:
    CertError: could not search for certificates
Finds certificates by attribute.
Finds certificates by attribute .
def FindCertificates(subject=None, subject_cn=None, issuer=None, issuer_cn=None,
                     startdate=None, enddate=None, certhash=None,
                     fingerprint=None, email=None, keychain=None):
                     # pylint: disable=unused-argument
  """Finds certificates by attribute.

  Multiple attributes are ANDed together.

  To do this, we get a list of all matching certs with a list comprehension,
  then run a reduce multiplying all results. Since bools multiply as ints, a
  False means multiply by 0 so any False match makes the whole thing False.

  Args:
    subject: str, find certificate by full subject
    subject_cn: str, find certificate by subject CN
    issuer: str, find certificate by issuer
    issuer_cn: str, find certificate by issuer CN
    startdate: str, find certificate by notBefore date
    enddate: str, find certificate by notAfter date
    certhash: str, find certificate by SHA-1 hash of suject name
    fingerprint: str, find certificate by fingerprint
    email: str, find certificates by email address
    keychain: str, which keychain to look in
  Returns:
    List of matching Certificate objects
  Raises:
    CertError: could not search for certificates
  """

  attrs = vars().keys()[:]
  attrs.remove('keychain')
  allcerts = _GetCertificates(keychain=keychain)
  matchedcerts = []

  for cert in allcerts:
    if reduce(operator.mul,  # pylint: disable=bad-builtin
              [(cert.get(k) == eval(k))  # pylint: disable=eval-used
               for k in attrs
               if eval(k)],  # pylint: disable=eval-used
              True):
      matchedcerts.append(cert)
  return matchedcerts
def FindCertificates ( subject = None , subject_cn = None , issuer = None , issuer_cn = None , startdate = None , enddate = None , certhash = None , fingerprint = None , email = None , keychain = None ) : # pylint: disable=unused-argument attrs = vars ( ) . keys ( ) [ : ] attrs . remove ( 'keychain' ) allcerts = _GetCertificates ( keychain = keychain ) matchedcerts = [ ] for cert in allcerts : if reduce ( operator . mul , # pylint: disable=bad-builtin [ ( cert . get ( k ) == eval ( k ) ) # pylint: disable=eval-used for k in attrs if eval ( k ) ] , # pylint: disable=eval-used True ) : matchedcerts . append ( cert ) return matchedcerts