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

Side by Side Diff: net/data/verify_signed_data_unittest/ecdsa-secp384r1-sha256.pem

Issue 1209283004: Implement VerifySignedData() for ECDSA, RSA PKCS#1 and RSA PSS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@parse_pss
Patch Set: mark rsaPss key tests as DISABLED Created 5 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 This test data was produced by creating a self-signed EC cert using OpenSSL,
2 and then extracting the relevant fields.
3
4 It uses ECDSA with curve secp384r1 an SHA-256.
5
6 (1) Generate self-signed certificate
7
8 openssl ecparam -out ec_key.pem -name secp384r1 -genkey
9 openssl req -new -key ec_key.pem -x509 -nodes -days 365 -out cert.pem
10
11 (2) Extract public key
12
13 openssl x509 -in cert.pem -pubkey -noout > pubkey.pem
14 cat pubkey.pem
15
16 (3) Extract signed data (tbsCertificate)
17
18 openssl asn1parse -in cert.pem -out tbs -noout -strparse 4
19 base64 tbs
20
21 (4) Extract signature algorithm
22
23 # Find the offset of the signature algorithm near the end (496 in this case)
24 openssl asn1parse -in cert.pem
25
26 openssl asn1parse -in cert.pem -out alg -noout -strparse 496
27 base64 alg
28
29 (5) Extract the signature
30
31 # Find the final offset of BIT STRING (508 in this case)
32 openssl asn1parse -in cert.pem
33
34 openssl asn1parse -in cert.pem -out sig -noout -strparse 508
35 base64 sig
36
37
38 -----BEGIN PUBLIC KEY-----
39 MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEXFhBi+WKXuxeK9yCbC9jqEchwjCNsQ4R
40 XAsJ07oHZ+Qqz55cNIY5BAhcQ0QYY5jv9BimGL9SuhUuOSuS3Pn9rrsIFGcFsihy
41 4kDr8rq5+7RbN8bV057gW5emYjLtvDsQ
42 -----END PUBLIC KEY-----
43
44 -----BEGIN ALGORITHM-----
45 MAoGCCqGSM49BAMC
46 -----END ALGORITHM-----
47
48 -----BEGIN DATA-----
49 MIIB6KADAgECAgkAtUVxft6/Vc0wCgYIKoZIzj0EAwIwbzELMAkGA1UEBhMCQVUxEzARBgNVBAgM
50 ClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEMMAoGA1UEAwwD
51 YWhhMRowGAYJKoZIhvcNAQkBFgtzdXBAZm9vLmNvbTAeFw0xNTA3MDIwMDM4MTRaFw0xNjA3MDEw
52 MDM4MTRaMG8xCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRl
53 cm5ldCBXaWRnaXRzIFB0eSBMdGQxDDAKBgNVBAMMA2FoYTEaMBgGCSqGSIb3DQEJARYLc3VwQGZv
54 by5jb20wdjAQBgcqhkjOPQIBBgUrgQQAIgNiAARcWEGL5Ype7F4r3IJsL2OoRyHCMI2xDhFcCwnT
55 ugdn5CrPnlw0hjkECFxDRBhjmO/0GKYYv1K6FS45K5Lc+f2uuwgUZwWyKHLiQOvyurn7tFs3xtXT
56 nuBbl6ZiMu28OxCjUDBOMB0GA1UdDgQWBBR6nDgtPalG2JvSlWzdGRCi/Cu7NjAfBgNVHSMEGDAW
57 gBR6nDgtPalG2JvSlWzdGRCi/Cu7NjAMBgNVHRMEBTADAQH/
58 -----END DATA-----
59
60 -----BEGIN SIGNATURE-----
61 MGYCMQCDwMSZVJZ8qThiNTV7VX57m8fdNnNS6cXIjRYoh4SozlYWmWGh87nhmJJCeD16jVMCMQDk
62 roAY8oNi8RxLUor+LozhhVgu24tu6lcp4MP8H3Zy8bBea5HerAd1AqJp3Ox7KDU=
63 -----END SIGNATURE-----
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698