def METHOD_NAME(self, ticket):
    decoded = json.loads(base64.b64decode(ticket))
    if self._peer is not None:
        x509cert = self._peer
    else:
        x509cert = x509.load_pem_x509_certificate(
            data=decoded['certificate'].encode('utf8'),
            backend=default_backend(),
        )
    if self._ca is not None:
        self._verifyCertificate(self._ca, x509cert)
    if self._eku is not None:
        certekus = x509cert.extensions.get_extension_for_oid(
            x509.oid.ExtensionOID.EXTENDED_KEY_USAGE
        ).value
        if self._eku not in (eku.dotted_string for eku in certekus):
            raise ValueError('Certificate is not authorized for action')
    signedFields = [s.strip() for s in decoded['signedFields'].split(',')]
    if len(
        set(['salt', 'data']) &
        set(signedFields)
    ) == 0:
        raise ValueError('Invalid ticket')
    pkey = x509cert.public_key()
    if 'v2_signature' in decoded:
        md = hashes.SHA256()
    else:
        raise RuntimeError('Unknown message digest algorithm')
    hasher = hashes.Hash(md, backend=default_backend())
    for field in signedFields:
        hasher.update(decoded[field].encode('utf8'))
    digest = hasher.finalize()
    try:
        if 'v2_signature' in decoded:
            res = pkey.verify(
                base64.b64decode(decoded['v2_signature']),
                digest,
                padding.PSS(
                    mgf=padding.MGF1(hashes.SHA256()),
                    salt_length=padding.PSS.MAX_LENGTH,
                ),
                utils.Prehashed(md),
            )
        if res is not None:
            raise RuntimeError('Certificate validation failed')
    except InvalidSignature:
        raise ValueError('Invalid ticket signature')
    if not (
        self._parseDate(decoded['validFrom']) <=
        datetime.datetime.utcnow() <=
        self._parseDate(decoded['validTo'])
    ):
        raise ValueError('Ticket life time expired')
    return decoded['data']