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

Unified 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: nop? 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 side-by-side diff with in-line comments
Download patch
Index: net/data/verify_signed_data_unittest/ecdsa-secp384r1-sha256.pem
diff --git a/net/data/verify_signed_data_unittest/ecdsa-secp384r1-sha256.pem b/net/data/verify_signed_data_unittest/ecdsa-secp384r1-sha256.pem
new file mode 100644
index 0000000000000000000000000000000000000000..94f48a9e2b37a97bc1ba084071c5c4ed144c0bad
--- /dev/null
+++ b/net/data/verify_signed_data_unittest/ecdsa-secp384r1-sha256.pem
@@ -0,0 +1,63 @@
+This test data was produced by creating a self-signed EC cert using OpenSSL,
+and then extracting the relevant fields.
+
+It uses ECDSA with curve secp384r1 an SHA-256.
+
+(1) Generate self-signed certificate
+
+ openssl ecparam -out ec_key.pem -name secp384r1 -genkey
+ openssl req -new -key ec_key.pem -x509 -nodes -days 365 -out cert.pem
+
+(2) Extract public key
+
+ openssl x509 -in cert.pem -pubkey -noout > pubkey.pem
+ cat pubkey.pem
+
+(3) Extract signed data (tbsCertificate)
+
+ openssl asn1parse -in cert.pem -out tbs -noout -strparse 4
+ base64 tbs
+
+(4) Extract signature algorithm
+
+ # Find the offset of the signature algorithm near the end (496 in this case)
+ openssl asn1parse -in cert.pem
+
+ openssl asn1parse -in cert.pem -out alg -noout -strparse 496
+ base64 alg
+
+(5) Extract the signature
+
+ # Find the final offset of BIT STRING (508 in this case)
+ openssl asn1parse -in cert.pem
+
+ openssl asn1parse -in cert.pem -out sig -noout -strparse 508
+ base64 sig
+
+
+-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k
+roAY8oNi8RxLUor+LozhhVgu24tu6lcp4MP8H3Zy8bBea5HerAd1AqJp3Ox7KDU=
+-----END SIGNATURE-----

Powered by Google App Engine
This is Rietveld 408576698