Index: net/data/verify_signed_data_unittest/rsa-pkcs1-sha256.pem |
diff --git a/net/data/verify_signed_data_unittest/rsa-pkcs1-sha256.pem b/net/data/verify_signed_data_unittest/rsa-pkcs1-sha256.pem |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0ae5972f5bd8b0780d7a897cc0804c4c54fdb653 |
--- /dev/null |
+++ b/net/data/verify_signed_data_unittest/rsa-pkcs1-sha256.pem |
@@ -0,0 +1,65 @@ |
+This test data was produced by creating a self-signed EC cert using OpenSSL, |
+and then extracting the relevant fields. |
+ |
+It uses RSA PKCS#1 v1.5 with SHA-256 and a 1024-bit key. |
+ |
+(1) Generate self-signed certificate |
+ |
+ openssl genrsa -out rsa_key.pem 1024 |
+ openssl req -new -key rsa_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 (491 in this case) |
+ openssl asn1parse -in cert.pem |
+ |
+ openssl asn1parse -in cert.pem -out alg -noout -strparse 491 |
+ base64 alg |
+ |
+(5) Extract the signature |
+ |
+ # Find the final offset of BIT STRING (506 in this case) |
+ openssl asn1parse -in cert.pem |
+ |
+ openssl asn1parse -in cert.pem -out sig -noout -strparse 506 |
+ base64 sig |
+ |
+ |
+-----BEGIN PUBLIC KEY----- |
+MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqR+B2Mj1irNp1JnY2zQIQRQPz |
+7ybs6mUjHT3hf5APyaig2u6fBPThqxssgg0YviqIj/70hVK/JXcqP1zgR5AhsA0a |
+gnwAjfB/ow4EH+3HEYV52qpxN98pUxC+1l2hgVtn8xCS/JGyjK+6dv+lZw3ixJoX |
+2RjVtdJ4/cn318EhhQIDAQAB |
+-----END PUBLIC KEY----- |
+ |
+-----BEGIN ALGORITHM----- |
+MA0GCSqGSIb3DQEBCwUA |
+-----END ALGORITHM----- |
+ |
+-----BEGIN DATA----- |
+MIIB46ADAgECAgkA3l4tFOVii0UwDQYJKoZIhvcNAQELBQAwVjELMAkGA1UEBhMCQVUxEzARBgNV |
+BAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEPMA0GA1UE |
+AwwGTXkga2V5MB4XDTE1MDcwMjE3MDYzOVoXDTE2MDcwMTE3MDYzOVowVjELMAkGA1UEBhMCQVUx |
+EzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEP |
+MA0GA1UEAwwGTXkga2V5MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqR+B2Mj1irNp1JnY2 |
+zQIQRQPz7ybs6mUjHT3hf5APyaig2u6fBPThqxssgg0YviqIj/70hVK/JXcqP1zgR5AhsA0agnwA |
+jfB/ow4EH+3HEYV52qpxN98pUxC+1l2hgVtn8xCS/JGyjK+6dv+lZw3ixJoX2RjVtdJ4/cn318Eh |
+hQIDAQABo1AwTjAdBgNVHQ4EFgQUzQBVKTEknyLndWd2HTsBdTKvyikwHwYDVR0jBBgwFoAUzQBV |
+KTEknyLndWd2HTsBdTKvyikwDAYDVR0TBAUwAwEB/w== |
+-----END DATA----- |
+ |
+-----BEGIN SIGNATURE----- |
+OsdKYVInD8a/uGzk83OlonACuL+yK1qshl/M39KNH6fwvzJ5MSiINvX4GTGUW9e88dNo4qg7daWy |
+U007GHVbn8mRhgY5SQJzIiOeWfqpLnrSKZyvdU2OiZP8zwzYiyz6smIpq7VNG5o/sfyLr4ap/exo |
+Z2vz8ue8UB01C+RqVC0= |
+-----END SIGNATURE----- |