'Parses signed certificate data and updates result rdfvalue.'

@staticmethod
def ParseSignedData(signed_data, result):

    try:
        auth_data
    except NameError:
        return
    try:
        try:
            auth = auth_data.AuthData(signed_data.certificate)
        except Exception as e:
            result.cert_hasher_name = ('Error    parsing    certificate:    %s' % str(e))
            raise
        result.cert_hasher_name = auth.digest_algorithm().name
        result.cert_program_name = str(auth.program_name)
        result.cert_program_url = str(auth.program_url)
        result.cert_signing_id = str(auth.signing_cert_id)
        try:
            auth.ValidateCertChains(time.gmtime())
        except auth_data.Asn1Error:
            pass
        result.cert_chain_head_issuer = str(auth.cert_chain_head[2])
        if auth.has_countersignature:
            result.cert_countersignature_chain_head_issuer = str(auth.counter_chain_head[2])
        certs = []
        for ((issuer, serial), cert) in auth.certificates.items():
            subject = cert[0][0]['subject']
            subject_dn = str(dn.DistinguishedName.TraverseRdn(subject[0]))
            not_before = cert[0][0]['validity']['notBefore']
            not_after = cert[0][0]['validity']['notAfter']
            not_before_time = not_before.ToPythonEpochTime()
            not_after_time = not_after.ToPythonEpochTime()
            not_before_time_str = time.asctime(time.gmtime(not_before_time))
            not_after_time_str = time.asctime(time.gmtime(not_after_time))
            certs.append(dict(issuer=issuer, serial=serial, subject=subject_dn, not_before_time=not_before_time_str, not_after_time=not_after_time_str))
        result.cert_certificates = str(certs)
    except Exception as e:
        logging.error(e)
