Esempio n. 1
0
 def start_requests(self):
     #         这是一个重载函数,作用是发出第一个Request请求
     # 带着headers、cookies去请求self.start_urls[0],返回的response会被送到
     # 回调函数parse中
     yield Request(self.start_urls[0],
                   callback=self.parse,
                   headers=self.headers)
def _create_ocsp_request(issuer, subject):
    """
    Create CertId and OCSPRequest
    """
    cert_id = CertId({
        'hash_algorithm':
        DigestAlgorithm({
            'algorithm': u'sha1',
            'parameters': None
        }),
        'issuer_name_hash':
        OctetString(subject.issuer.sha1),
        'issuer_key_hash':
        OctetString(issuer.public_key.sha1),
        'serial_number':
        subject.serial_number,
    })
    req = OCSPRequest({
        'tbs_request':
        TBSRequest({
            'version':
            Version(0),
            'request_list':
            Requests([Request({
                'req_cert': cert_id,
            })]),
        }),
    })
    return cert_id, req
Esempio n. 3
0
 def create_ocsp_request(self, issuer, subject):
     """Creates CertId and OCSPRequest."""
     cert_id = CertId({
         "hash_algorithm":
         DigestAlgorithm({
             "algorithm": "sha1",
             "parameters": None
         }),
         "issuer_name_hash":
         OctetString(subject.issuer.sha1),
         "issuer_key_hash":
         OctetString(issuer.public_key.sha1),
         "serial_number":
         subject.serial_number,
     })
     ocsp_request = OCSPRequest({
         "tbs_request":
         TBSRequest({
             "version":
             Version(0),
             "request_list":
             Requests([Request({
                 "req_cert": cert_id,
             })]),
         }),
     })
     return cert_id, ocsp_request