def _GetCN(self, x509cert):
    subject = x509cert.get_subject()
    try:
      cn_id = subject.nid["CN"]
      cn = subject.get_entries_by_nid(cn_id)[0]
    except __HOLE__:
      raise rdfvalue.DecodeError("Cert has no CN")

    self.common_name = rdfvalue.RDFURN(cn.get_data().as_text())
dataset/ETHPy150Open google/grr/grr/lib/rdfvalues/crypto.py/RDFX509Cert._GetCN