Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Unified Diff: net/data/parse_certificate_unittest/serial_number_21_octets_leading_0.pem

Issue 1279963003: Add a function for parsing RFC 5280's "TBSCertificate". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cert_mapper
Patch Set: Fully move expectations to test data Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/data/parse_certificate_unittest/serial_number_21_octets_leading_0.pem
diff --git a/net/data/parse_certificate_unittest/serial_number_21_octets_leading_0.pem b/net/data/parse_certificate_unittest/serial_number_21_octets_leading_0.pem
new file mode 100644
index 0000000000000000000000000000000000000000..43f5c9768023a27349de39705d9cce6e31b5bec2
--- /dev/null
+++ b/net/data/parse_certificate_unittest/serial_number_21_octets_leading_0.pem
@@ -0,0 +1,183 @@
+$ openssl x509 -inform DER -text -noout < [CERTIFICATE]
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number:
+ d8:c3:7e:4d:87:f9:c8:c8:2b:af:26:ef:53:50:1d:f1:fc:f3:a5:20
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=IT, ST=IT, O=Postecom S.p.A., OU=Servizi di Certificazione, CN=Postecom CS3
+ Validity
+ Not Before: Apr 17 14:34:23 2012 GMT
+ Not After : Apr 17 14:34:23 2013 GMT
+ Subject: C=IT, O=Poste Italiane S.p.A., OU=Postecom S.p.A., CN=mail.uniroma3.it
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ Public-Key: (1024 bit)
+ Modulus:
+ 00:b4:62:c0:3a:48:45:cb:6a:44:5f:31:15:2e:4f:
+ 50:40:a4:6b:1f:f3:9c:69:e3:ad:d9:b6:0d:bf:cf:
+ 2e:09:a4:c9:94:a9:de:0b:03:30:a2:37:be:88:81:
+ 7f:fe:1b:17:9b:81:6b:0c:f5:f3:a3:f2:50:7c:cc:
+ ee:6b:95:5e:98:6a:c0:03:bb:62:81:12:29:fb:ac:
+ 00:29:92:87:db:8c:5f:f9:eb:5b:29:f6:b4:35:4a:
+ c3:a0:0c:83:38:b1:7d:76:f8:67:e9:db:15:f9:f4:
+ 16:03:61:d3:3e:e8:8c:0b:54:2e:fd:d4:84:3c:04:
+ fe:8a:d2:7a:10:6f:59:aa:1f
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Basic Constraints:
+ CA:FALSE
+ X509v3 Certificate Policies:
+ Policy: 1.3.76.11.1.1.4.1
+ CPS: http://postecert.poste.it/manualioperativi/
+
+ X509v3 Key Usage: critical
+ Digital Signature, Key Encipherment, Data Encipherment, Key Agreement
+ X509v3 Extended Key Usage:
+ TLS Web Server Authentication, TLS Web Client Authentication
+ X509v3 Authority Key Identifier:
+ DirName:/C=IE/O=Baltimore/OU=CyberTrust/CN=Baltimore CyberTrust Root
+ serial:07:27:52:62
+
+ X509v3 CRL Distribution Points:
+
+ Full Name:
+ URI:http://postecert.poste.it/postecomcs3/crl.crl
+
+ Signature Algorithm: sha1WithRSAEncryption
+ 74:40:d4:35:ea:05:12:1f:b5:e7:2f:d8:2b:00:30:4c:32:2b:
+ a4:b0:35:55:74:cb:c0:03:56:ad:27:2c:5e:46:85:0a:93:4f:
+ 3f:1e:93:d9:a6:de:3b:f5:54:41:60:6f:3a:81:99:48:96:e4:
+ 52:b9:f7:39:90:7e:c7:b6:2f:4f:9b:bb:e6:e9:58:d1:25:4e:
+ 0a:e3:3f:bb:ff:b1:7b:a1:d3:1e:86:29:62:8d:61:48:1b:10:
+ eb:22:a7:d2:05:8d:f9:a2:7e:d2:c5:1c:c3:2e:b8:b3:97:49:
+ bd:b9:f1:4c:1f:d6:d9:ca:71:5d:5b:85:66:3e:5f:25:00:ec:
+ af:50:48:35:a1:59:0d:62:2c:e0:a0:b2:b2:cb:d6:9b:7b:01:
+ 5b:83:ee:f0:48:aa:6d:b6:10:37:96:db:56:aa:d8:4f:9e:e5:
+ 2a:68:fb:8b:2d:8f:0e:c6:6a:88:2f:90:a6:f5:b2:bb:e0:be:
+ 05:3e:f3:22:35:cc:0b:e5:e3:53:76:7d:fb:f8:7d:29:2c:3b:
+ f8:b6:75:44:c6:b1:8c:c4:24:81:14:86:8c:c4:dd:ff:a5:21:
+ d6:5a:ce:3a:be:1b:c1:94:ea:f7:67:10:8d:db:d1:47:ce:86:
+ 10:7e:be:db:54:87:c2:67:8c:0e:aa:dd:87:9f:3d:12:dc:40:
+ 32:68:f9:f4
+
+
+$ openssl asn1parse -i -inform DER < [CERTIFICATE]
+ 0:d=0 hl=4 l=1054 cons: SEQUENCE
+ 4:d=1 hl=4 l= 774 cons: SEQUENCE
+ 8:d=2 hl=2 l= 3 cons: cont [ 0 ]
+ 10:d=3 hl=2 l= 1 prim: INTEGER :02
+ 13:d=2 hl=2 l= 21 prim: INTEGER :D8C37E4D87F9C8C82BAF26EF53501DF1FCF3A520
+ 36:d=2 hl=2 l= 13 cons: SEQUENCE
+ 38:d=3 hl=2 l= 9 prim: OBJECT :sha1WithRSAEncryption
+ 49:d=3 hl=2 l= 0 prim: NULL
+ 51:d=2 hl=2 l= 111 cons: SEQUENCE
+ 53:d=3 hl=2 l= 11 cons: SET
+ 55:d=4 hl=2 l= 9 cons: SEQUENCE
+ 57:d=5 hl=2 l= 3 prim: OBJECT :countryName
+ 62:d=5 hl=2 l= 2 prim: PRINTABLESTRING :IT
+ 66:d=3 hl=2 l= 11 cons: SET
+ 68:d=4 hl=2 l= 9 cons: SEQUENCE
+ 70:d=5 hl=2 l= 3 prim: OBJECT :stateOrProvinceName
+ 75:d=5 hl=2 l= 2 prim: UTF8STRING :IT
+ 79:d=3 hl=2 l= 24 cons: SET
+ 81:d=4 hl=2 l= 22 cons: SEQUENCE
+ 83:d=5 hl=2 l= 3 prim: OBJECT :organizationName
+ 88:d=5 hl=2 l= 15 prim: UTF8STRING :Postecom S.p.A.
+ 105:d=3 hl=2 l= 34 cons: SET
+ 107:d=4 hl=2 l= 32 cons: SEQUENCE
+ 109:d=5 hl=2 l= 3 prim: OBJECT :organizationalUnitName
+ 114:d=5 hl=2 l= 25 prim: UTF8STRING :Servizi di Certificazione
+ 141:d=3 hl=2 l= 21 cons: SET
+ 143:d=4 hl=2 l= 19 cons: SEQUENCE
+ 145:d=5 hl=2 l= 3 prim: OBJECT :commonName
+ 150:d=5 hl=2 l= 12 prim: UTF8STRING :Postecom CS3
+ 164:d=2 hl=2 l= 30 cons: SEQUENCE
+ 166:d=3 hl=2 l= 13 prim: UTCTIME :120417143423Z
+ 181:d=3 hl=2 l= 13 prim: UTCTIME :130417143423Z
+ 196:d=2 hl=2 l= 98 cons: SEQUENCE
+ 198:d=3 hl=2 l= 11 cons: SET
+ 200:d=4 hl=2 l= 9 cons: SEQUENCE
+ 202:d=5 hl=2 l= 3 prim: OBJECT :countryName
+ 207:d=5 hl=2 l= 2 prim: PRINTABLESTRING :IT
+ 211:d=3 hl=2 l= 30 cons: SET
+ 213:d=4 hl=2 l= 28 cons: SEQUENCE
+ 215:d=5 hl=2 l= 3 prim: OBJECT :organizationName
+ 220:d=5 hl=2 l= 21 prim: UTF8STRING :Poste Italiane S.p.A.
+ 243:d=3 hl=2 l= 24 cons: SET
+ 245:d=4 hl=2 l= 22 cons: SEQUENCE
+ 247:d=5 hl=2 l= 3 prim: OBJECT :organizationalUnitName
+ 252:d=5 hl=2 l= 15 prim: UTF8STRING :Postecom S.p.A.
+ 269:d=3 hl=2 l= 25 cons: SET
+ 271:d=4 hl=2 l= 23 cons: SEQUENCE
+ 273:d=5 hl=2 l= 3 prim: OBJECT :commonName
+ 278:d=5 hl=2 l= 16 prim: UTF8STRING :mail.uniroma3.it
+ 296:d=2 hl=3 l= 159 cons: SEQUENCE
+ 299:d=3 hl=2 l= 13 cons: SEQUENCE
+ 301:d=4 hl=2 l= 9 prim: OBJECT :rsaEncryption
+ 312:d=4 hl=2 l= 0 prim: NULL
+ 314:d=3 hl=3 l= 141 prim: BIT STRING
+ 458:d=2 hl=4 l= 320 cons: cont [ 3 ]
+ 462:d=3 hl=4 l= 316 cons: SEQUENCE
+ 466:d=4 hl=2 l= 9 cons: SEQUENCE
+ 468:d=5 hl=2 l= 3 prim: OBJECT :X509v3 Basic Constraints
+ 473:d=5 hl=2 l= 2 prim: OCTET STRING [HEX DUMP]:3000
+ 477:d=4 hl=2 l= 79 cons: SEQUENCE
+ 479:d=5 hl=2 l= 3 prim: OBJECT :X509v3 Certificate Policies
+ 484:d=5 hl=2 l= 72 prim: OCTET STRING [HEX DUMP]:3046304406072B4C0B010104013039303706082B06010505070201162B687474703A2F2F706F737465636572742E706F7374652E69742F6D616E75616C696F70657261746976692F
+ 558:d=4 hl=2 l= 14 cons: SEQUENCE
+ 560:d=5 hl=2 l= 3 prim: OBJECT :X509v3 Key Usage
+ 565:d=5 hl=2 l= 1 prim: BOOLEAN :255
+ 568:d=5 hl=2 l= 4 prim: OCTET STRING [HEX DUMP]:030203B8
+ 574:d=4 hl=2 l= 29 cons: SEQUENCE
+ 576:d=5 hl=2 l= 3 prim: OBJECT :X509v3 Extended Key Usage
+ 581:d=5 hl=2 l= 22 prim: OCTET STRING [HEX DUMP]:301406082B0601050507030106082B06010505070302
+ 605:d=4 hl=2 l= 111 cons: SEQUENCE
+ 607:d=5 hl=2 l= 3 prim: OBJECT :X509v3 Authority Key Identifier
+ 612:d=5 hl=2 l= 104 prim: OCTET STRING [HEX DUMP]:3066A15EA45C305A310B300906035504061302494531123010060355040A130942616C74696D6F726531133011060355040B130A43796265725472757374312230200603550403131942616C74696D6F7265204379626572547275737420526F6F74820407275262
+ 718:d=4 hl=2 l= 62 cons: SEQUENCE
+ 720:d=5 hl=2 l= 3 prim: OBJECT :X509v3 CRL Distribution Points
+ 725:d=5 hl=2 l= 55 prim: OCTET STRING [HEX DUMP]:30353033A031A02F862D687474703A2F2F706F737465636572742E706F7374652E69742F706F737465636F6D6373332F63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liZXJUcnVz
+dDEiMCAGA1UEAxMZQmFsdGltb3JlIEN5YmVyVHJ1c3QgUm9vdIIEBydSYjA+BgNVHR8ENzA1MDO
+gMaAvhi1odHRwOi8vcG9zdGVjZXJ0LnBvc3RlLml0L3Bvc3RlY29tY3MzL2NybC5jcmwwDQYJKo
+ZIhvcNAQEFBQADggEBAHRA1DXqBRIftecv2CsAMEwyK6SwNVV0y8ADVq0nLF5GhQqTTz8ek9mm3
+jv1VEFgbzqBmUiW5FK59zmQfse2L0+bu+bpWNElTgrjP7v/sXuh0x6GKWKNYUgbEOsip9IFjfmi
+ftLFHMMuuLOXSb258Uwf1tnKcV1bhWY+XyUA7K9QSDWhWQ1iLOCgsrLL1pt7AVuD7vBIqm22EDe
+W21aq2E+e5Spo+4stjw7GaogvkKb1srvgvgU+8yI1zAvl41N2ffv4fSksO/i2dUTGsYzEJIEUho
+zE3f+lIdZazjq+G8GU6vdnEI3b0UfOhhB+vttUh8JnjA6q3YefPRLcQDJo+fQ=
+-----END CERTIFICATE-----
+
+
+-----BEGIN SIGNATURE-----
+dEDUNeoFEh+15y/YKwAwTDIrpLA1VXTLwANWrScsXkaFCpNPPx6T2abeO/VUQWBvOoGZSJbkUrn
+3OZB+x7YvT5u75ulY0SVOCuM/u/+xe6HTHoYpYo1hSBsQ6yKn0gWN+aJ+0sUcwy64s5dJvbnxTB
+/W2cpxXVuFZj5fJQDsr1BINaFZDWIs4KCyssvWm3sBW4Pu8EiqbbYQN5bbVqrYT57lKmj7iy2PD
+sZqiC+QpvWyu+C+BT7zIjXMC+XjU3Z9+/h9KSw7+LZ1RMaxjMQkgRSGjMTd/6Uh1lrOOr4bwZTq
+92cQjdvRR86GEH6+21SHwmeMDqrdh589EtxAMmj59A==
+-----END SIGNATURE-----
+
+$ openssl asn1parse -i -inform DER < [SIGNATURE ALGORITHM]
+ 0:d=0 hl=2 l= 13 cons: SEQUENCE
+ 2:d=1 hl=2 l= 9 prim: OBJECT :sha1WithRSAEncryption
+ 13:d=1 hl=2 l= 0 prim: NULL
+-----BEGIN SIGNATURE ALGORITHM-----
+MA0GCSqGSIb3DQEBBQUA
+-----END SIGNATURE ALGORITHM-----
+

Powered by Google App Engine
This is Rietveld 408576698