Lines Matching refs:asn1
5 import asn1
68 return '\x00' * (self.modlen - len(out)) + asn1.ToBytes(out)
71 return asn1.ToDER(asn1.SEQUENCE([self.m, self.e]))
75 names = asn1.SEQUENCE([])
79 asn1.SET([
80 asn1.SEQUENCE([
88 asn1.SET([
89 asn1.SEQUENCE([
97 asn1.SET([
98 asn1.SEQUENCE([
136 CERT_POLICY_OID = asn1.OID([1, 3, 6, 1, 4, 1, 11129, 2, 4, 1])
158 AIA_OCSP = asn1.OID([1, 3, 6, 1, 5, 5, 7, 48, 1])
159 AUTHORITY_INFORMATION_ACCESS = asn1.OID([1, 3, 6, 1, 5, 5, 7, 1, 1])
160 BASIC_CONSTRAINTS = asn1.OID([2, 5, 29, 19])
161 CERT_POLICIES = asn1.OID([2, 5, 29, 32])
162 COMMON_NAME = asn1.OID([2, 5, 4, 3])
163 COUNTRY = asn1.OID([2, 5, 4, 6])
164 HASH_SHA1 = asn1.OID([1, 3, 14, 3, 2, 26])
165 OCSP_TYPE_BASIC = asn1.OID([1, 3, 6, 1, 5, 5, 7, 48, 1, 1])
166 ORGANIZATION = asn1.OID([2, 5, 4, 10])
167 PUBLIC_KEY_RSA = asn1.OID([1, 2, 840, 113549, 1, 1, 1])
168 SHA256_WITH_RSA_ENCRYPTION = asn1.OID([1, 2, 840, 113549, 1, 1, 11])
174 extensions = asn1.SEQUENCE([])
185 asn1.SEQUENCE([
188 asn1.OCTETSTRING(asn1.ToDER(asn1.SEQUENCE([
196 asn1.SEQUENCE([
199 asn1.OCTETSTRING(asn1.ToDER(asn1.SEQUENCE([
200 asn1.SEQUENCE([
202 asn1.Raw(asn1.TagAndLength(0x86, len(ocsp_url)) + ocsp_url),
208 asn1.SEQUENCE([
211 asn1.OCTETSTRING(asn1.ToDER(asn1.SEQUENCE([
212 asn1.SEQUENCE([ # PolicyInformation
219 tbsCert = asn1.ToDER(asn1.SEQUENCE([
220 asn1.Explicit(0, 2), # Version
222 asn1.SEQUENCE([SHA256_WITH_RSA_ENCRYPTION, None]), # SignatureAlgorithm
224 asn1.SEQUENCE([ # Validity
225 asn1.UTCTime("100101060000Z"), # NotBefore
226 asn1.UTCTime("321201060000Z"), # NotAfter
229 asn1.SEQUENCE([ # SubjectPublicKeyInfo
230 asn1.SEQUENCE([ # Algorithm
234 asn1.BitString(asn1.ToDER(pubkey)),
236 asn1.Explicit(3, extensions),
239 return asn1.ToDER(asn1.SEQUENCE([
240 asn1.Raw(tbsCert),
241 asn1.SEQUENCE([
245 asn1.BitString(privkey.Sign(tbsCert)),
251 issuer_name_hash = asn1.OCTETSTRING(
252 hashlib.sha1(asn1.ToDER(Name(cn = issuer_cn))).digest())
254 issuer_key_hash = asn1.OCTETSTRING(
255 hashlib.sha1(asn1.ToDER(issuer_key)).digest())
259 cert_status = asn1.Explicit(1, asn1.GeneralizedTime("20100101060000Z"))
261 cert_status = asn1.Raw(asn1.TagAndLength(0x80 | 2, 0))
263 cert_status = asn1.Raw(asn1.TagAndLength(0x80 | 0, 0))
267 basic_resp_data_der = asn1.ToDER(asn1.SEQUENCE([
268 asn1.Explicit(2, issuer_key_hash),
269 asn1.GeneralizedTime("20100101060000Z"), # producedAt
270 asn1.SEQUENCE([
271 asn1.SEQUENCE([ # SingleResponse
272 asn1.SEQUENCE([ # CertID
273 asn1.SEQUENCE([ # hashAlgorithm
282 asn1.GeneralizedTime("20100101060000Z"), # thisUpdate
283 asn1.Explicit(0, asn1.GeneralizedTime("20300101060000Z")), # nextUpdate
288 basic_resp = asn1.SEQUENCE([
289 asn1.Raw(basic_resp_data_der),
290 asn1.SEQUENCE([
294 asn1.BitString(issuer_key.Sign(basic_resp_data_der)),
297 resp = asn1.SEQUENCE([
298 asn1.ENUMERATED(0),
299 asn1.Explicit(0, asn1.SEQUENCE([
301 asn1.OCTETSTRING(asn1.ToDER(basic_resp)),
305 return asn1.ToDER(resp)