diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2009-03-23 09:18:55 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2009-03-23 09:18:55 (GMT) |
commit | e5fcad302d86d316390c6b0f62759a067313e8a9 (patch) | |
tree | c2afbf6f1066b6ce261f14341cf6d310e5595bc1 /tests/auto/qsslcertificate/certificates | |
download | Qt-e5fcad302d86d316390c6b0f62759a067313e8a9.zip Qt-e5fcad302d86d316390c6b0f62759a067313e8a9.tar.gz Qt-e5fcad302d86d316390c6b0f62759a067313e8a9.tar.bz2 |
Long live Qt 4.5!
Diffstat (limited to 'tests/auto/qsslcertificate/certificates')
19 files changed, 153 insertions, 0 deletions
diff --git a/tests/auto/qsslcertificate/certificates/ca-cert.pem b/tests/auto/qsslcertificate/certificates/ca-cert.pem new file mode 100644 index 0000000..bcba68a --- /dev/null +++ b/tests/auto/qsslcertificate/certificates/ca-cert.pem @@ -0,0 +1,33 @@ +-----BEGIN CERTIFICATE----- +MIIC5TCCAk6gAwIBAgIBATANBgkqhkiG9w0BAQQFADBcMQswCQYDVQQGEwJBVTET +MBEGA1UECBMKUXVlZW5zbGFuZDEaMBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQx +HDAaBgNVBAMTE1Rlc3QgUENBICgxMDI0IGJpdCkwHhcNOTkxMjAyMjEzODUxWhcN +MDUwNzEwMjEzODUxWjBbMQswCQYDVQQGEwJBVTETMBEGA1UECBMKUXVlZW5zbGFu +ZDEaMBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxGzAZBgNVBAMTElRlc3QgQ0Eg +KDEwMjQgYml0KTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAo7ujy3XXpU/p +yDJtOxkMJmGv3mdiVm7JrdoKLUgqjO2rBaeNuYMUiuI6oYU+tlD6agwRML0Pn2JF +b90VdK/UXrmRr9djaEuH17EIKjte5RwOzndCndsjcCYyoeODMTyg7dqPIkDMmRNM +5R5xBTab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/wJBAJ/KjwZIrFVxewP0x2ILYsTRYLzz +MS4PDsO7FB+I0i7DbBOifXS2oNSpd3I0CNMwrxFnUHzynpbOStVfN3ZL5w0CQQCa +pwFahxBRhkJKsxhjoFJBX9yl75JoY4Wvm5Tbo9ih6UJaRx3kqfkN14L2BKYcsZgb +KY9vmDOYy6iNfjDeWTfJAkBkfPUb8oTJ/nSP5zN6sqGxSY4krc4xLxpRmxoJ8HL2 +XfhqXkTzbU13RX9JJ/NZ8vQN9Vm2NhxRGJocQkmcdVtJ +-----END RSA PRIVATE KEY----- diff --git a/tests/auto/qsslcertificate/certificates/ca-cert.pem.digest-md5 b/tests/auto/qsslcertificate/certificates/ca-cert.pem.digest-md5 new file mode 100644 index 0000000..800a05b --- /dev/null +++ b/tests/auto/qsslcertificate/certificates/ca-cert.pem.digest-md5 @@ -0,0 +1 @@ +MD5 Fingerprint=EF:02:83:EA:AC:AF:6A:D0:8D:4F:56:A8:2B:A1:C5:D3 diff --git a/tests/auto/qsslcertificate/certificates/ca-cert.pem.digest-sha1 b/tests/auto/qsslcertificate/certificates/ca-cert.pem.digest-sha1 new file mode 100644 index 0000000..df311a8 --- /dev/null +++ b/tests/auto/qsslcertificate/certificates/ca-cert.pem.digest-sha1 @@ -0,0 +1 @@ +SHA1 Fingerprint=A6:CC:2A:D7:E3:8F:49:E7:8B:4F:76:E8:E0:FA:37:5E:62:2F:66:23 diff --git a/tests/auto/qsslcertificate/certificates/cert-ss-san.pem b/tests/auto/qsslcertificate/certificates/cert-ss-san.pem new file mode 100644 index 0000000..3d0bdfc --- /dev/null +++ b/tests/auto/qsslcertificate/certificates/cert-ss-san.pem @@ -0,0 +1,13 @@ +-----BEGIN CERTIFICATE----- +MIIB9zCCAWCgAwIBAgIJAIyyZjJFdeyIMA0GCSqGSIb3DQEBBQUAMBwxGjAYBgNV +BAMTEUpvaG5ueSBHdWl0YXJDPU5PMB4XDTA3MDQyMDEwMzIzOVoXDTA3MDUyMDEw +MzIzOVowHDEaMBgGA1UEAxMRSm9obm55IEd1aXRhckM9Tk8wgZ8wDQYJKoZIhvcN +AQEBBQADgY0AMIGJAoGBANPgV/8gMg5Gh4vhfcoUTHXTqhcEuCh5VE/h57Ea7uj4 +1/bQtUNUvRZO21KtAmLHkFLoNQqeYbFJ4ZP7u/R/WDNk76EQtYNcMmJgSu/QRlxj +bEFFBOPPflQH7nYdneMegszzijRQ25oZhnjbyI0xZgqpNZwipBkC5lPgsrmlOckd +AgMBAAGjQTA/MD0GA1UdEQQ2MDSBD2FybmVAZm9vYmFyLm9yZ4IOd3d3LmZvb2Jh +ci5vcmeBEWJqYXJuZUBmb29iYXIub3JnMA0GCSqGSIb3DQEBBQUAA4GBAFVqCnFr +5EevQiVtAbDlTSbTJ3XWJSzjU0yf+tNYvPEIEqoDVh25YhSNWqRCMYFiUomj55WY +Rf7C4JM/eRlo99xnR4OtJzfLi+q1eKhl53cuwooajRjVOxQsdHpke51L9UzibKGw +0o8D/FNBw+D4GwIC1sdKw2UWAeaMhNzSEWKA +-----END CERTIFICATE----- diff --git a/tests/auto/qsslcertificate/certificates/cert-ss-san.pem.san b/tests/auto/qsslcertificate/certificates/cert-ss-san.pem.san new file mode 100644 index 0000000..f46a637 --- /dev/null +++ b/tests/auto/qsslcertificate/certificates/cert-ss-san.pem.san @@ -0,0 +1,5 @@ +[subj_alt_name] +subjectAltName=\ + email:arne@foobar.org,\ + DNS:www.foobar.org,\ + email:bjarne@foobar.org diff --git a/tests/auto/qsslcertificate/certificates/cert-ss.der b/tests/auto/qsslcertificate/certificates/cert-ss.der Binary files differnew file mode 100644 index 0000000..ea9eedc --- /dev/null +++ b/tests/auto/qsslcertificate/certificates/cert-ss.der diff --git a/tests/auto/qsslcertificate/certificates/cert-ss.der.pubkey b/tests/auto/qsslcertificate/certificates/cert-ss.der.pubkey Binary files differnew file mode 100644 index 0000000..48d2b99 --- /dev/null +++ b/tests/auto/qsslcertificate/certificates/cert-ss.der.pubkey diff --git a/tests/auto/qsslcertificate/certificates/cert-ss.pem b/tests/auto/qsslcertificate/certificates/cert-ss.pem new file mode 100644 index 0000000..b2626f3 --- /dev/null +++ b/tests/auto/qsslcertificate/certificates/cert-ss.pem @@ -0,0 +1,12 @@ +-----BEGIN CERTIFICATE----- +MIIByTCCATICCQDiwxj6Xps7zDANBgkqhkiG9w0BAQUFADApMRowGAYDVQQDExFu +YW1lL3dpdGgvc2xhc2hlczELMAkGA1UEBhMCTk8wHhcNMDcwNDE3MDc0MDI2WhcN +MDcwNTE3MDc0MDI2WjApMRowGAYDVQQDExFuYW1lL3dpdGgvc2xhc2hlczELMAkG +A1UEBhMCTk8wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOud6QOsME+pWANE +xxgmL0iT1ayg++hTxHsqAYnm/FoMxfUh+NdKkgJn2/GfNppinfPOSI667VqonU+7 +JBZDTLV5CPbZIo9fFQpDJQN6naev4yaxU1VeYFfI7S8c8zYKeGSR+RenNNeLvfH8 +0YxPpZZ1snv8IfDH2V8MVxiyr7lLAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAT9Kz +0kg75nMzcg23J0q6OGvkj0VO6QOaAwqt6v+Kp5kgOzUEisbVt9oxZrWwkEw6dFNN +cl7Blq6HQm6beezJobhEsi3G8OjVBrTDFb+jqPi/kwXuKL3QyfY2r/LRuINGrBDi +Ewg7KuI0qZPe0bQ9NCM5TCD6qCj4vx3HdIHU4Ew= +-----END CERTIFICATE----- diff --git a/tests/auto/qsslcertificate/certificates/cert-ss.pem.digest-md5 b/tests/auto/qsslcertificate/certificates/cert-ss.pem.digest-md5 new file mode 100644 index 0000000..62f4d76 --- /dev/null +++ b/tests/auto/qsslcertificate/certificates/cert-ss.pem.digest-md5 @@ -0,0 +1 @@ +MD5 Fingerprint=F4:2B:9D:73:2B:C8:26:56:60:9C:7F:58:66:07:4A:46 diff --git a/tests/auto/qsslcertificate/certificates/cert-ss.pem.digest-sha1 b/tests/auto/qsslcertificate/certificates/cert-ss.pem.digest-sha1 new file mode 100644 index 0000000..02430ed --- /dev/null +++ b/tests/auto/qsslcertificate/certificates/cert-ss.pem.digest-sha1 @@ -0,0 +1 @@ +SHA1 Fingerprint=B5:CF:31:AE:89:FB:BA:20:31:89:BA:71:06:7C:D7:84:9D:39:9E:46 diff --git a/tests/auto/qsslcertificate/certificates/cert-ss.pem.pubkey b/tests/auto/qsslcertificate/certificates/cert-ss.pem.pubkey new file mode 100644 index 0000000..5344d11 --- /dev/null +++ b/tests/auto/qsslcertificate/certificates/cert-ss.pem.pubkey @@ -0,0 +1,6 @@ +-----BEGIN PUBLIC KEY----- +MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDrnekDrDBPqVgDRMcYJi9Ik9Ws +oPvoU8R7KgGJ5vxaDMX1IfjXSpICZ9vxnzaaYp3zzkiOuu1aqJ1PuyQWQ0y1eQj2 +2SKPXxUKQyUDep2nr+MmsVNVXmBXyO0vHPM2CnhkkfkXpzTXi73x/NGMT6WWdbJ7 +/CHwx9lfDFcYsq+5SwIDAQAB +-----END PUBLIC KEY----- diff --git a/tests/auto/qsslcertificate/certificates/cert.der b/tests/auto/qsslcertificate/certificates/cert.der Binary files differnew file mode 100644 index 0000000..aeb8571 --- /dev/null +++ b/tests/auto/qsslcertificate/certificates/cert.der diff --git a/tests/auto/qsslcertificate/certificates/cert.der.pubkey b/tests/auto/qsslcertificate/certificates/cert.der.pubkey Binary files differnew file mode 100644 index 0000000..48d2b99 --- /dev/null +++ b/tests/auto/qsslcertificate/certificates/cert.der.pubkey diff --git a/tests/auto/qsslcertificate/certificates/cert.pem b/tests/auto/qsslcertificate/certificates/cert.pem new file mode 100644 index 0000000..295010c --- /dev/null +++ b/tests/auto/qsslcertificate/certificates/cert.pem @@ -0,0 +1,13 @@ +-----BEGIN CERTIFICATE----- +MIIB8zCCAVwCAREwDQYJKoZIhvcNAQEFBQAwWzELMAkGA1UEBhMCQVUxEzARBgNV +BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYD +VQQDExJUZXN0IENBICgxMDI0IGJpdCkwHhcNMDcwNDE3MDc0MDI2WhcNMDcwNTE3 +MDc0MDI2WjApMRowGAYDVQQDExFuYW1lL3dpdGgvc2xhc2hlczELMAkGA1UEBhMC +Tk8wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOud6QOsME+pWANExxgmL0iT +1ayg++hTxHsqAYnm/FoMxfUh+NdKkgJn2/GfNppinfPOSI667VqonU+7JBZDTLV5 +CPbZIo9fFQpDJQN6naev4yaxU1VeYFfI7S8c8zYKeGSR+RenNNeLvfH80YxPpZZ1 +snv8IfDH2V8MVxiyr7lLAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAleaU4pgzV6KY ++q9QuXapUYMsC2GiNtDmkG3k+MTHUO8XlE4hqPrIM6rRf7zKQdZ950R2wL9FSnYl +Qm1Tdv38dCka6ivMBqvRuOt9axH3m0G7nzHL7U3zaCbtEx3yVln+b3yYtiVpTuq0 +3MLrt7tQGAW6ra8ISf6YY1W65/uVXZE= +-----END CERTIFICATE----- diff --git a/tests/auto/qsslcertificate/certificates/cert.pem.digest-md5 b/tests/auto/qsslcertificate/certificates/cert.pem.digest-md5 new file mode 100644 index 0000000..5333f63 --- /dev/null +++ b/tests/auto/qsslcertificate/certificates/cert.pem.digest-md5 @@ -0,0 +1 @@ +MD5 Fingerprint=B6:CF:57:34:DA:A9:73:21:82:F7:CF:4D:3D:85:31:88 diff --git a/tests/auto/qsslcertificate/certificates/cert.pem.digest-sha1 b/tests/auto/qsslcertificate/certificates/cert.pem.digest-sha1 new file mode 100644 index 0000000..62f84de --- /dev/null +++ b/tests/auto/qsslcertificate/certificates/cert.pem.digest-sha1 @@ -0,0 +1 @@ +SHA1 Fingerprint=B6:D1:51:82:E0:29:CA:59:96:38:BD:B6:F9:40:05:91:6D:49:09:60 diff --git a/tests/auto/qsslcertificate/certificates/cert.pem.pubkey b/tests/auto/qsslcertificate/certificates/cert.pem.pubkey new file mode 100644 index 0000000..5344d11 --- /dev/null +++ b/tests/auto/qsslcertificate/certificates/cert.pem.pubkey @@ -0,0 +1,6 @@ +-----BEGIN PUBLIC KEY----- +MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDrnekDrDBPqVgDRMcYJi9Ik9Ws +oPvoU8R7KgGJ5vxaDMX1IfjXSpICZ9vxnzaaYp3zzkiOuu1aqJ1PuyQWQ0y1eQj2 +2SKPXxUKQyUDep2nr+MmsVNVXmBXyO0vHPM2CnhkkfkXpzTXi73x/NGMT6WWdbJ7 +/CHwx9lfDFcYsq+5SwIDAQAB +-----END PUBLIC KEY----- diff --git a/tests/auto/qsslcertificate/certificates/gencertificates.sh b/tests/auto/qsslcertificate/certificates/gencertificates.sh new file mode 100755 index 0000000..2c0bdea --- /dev/null +++ b/tests/auto/qsslcertificate/certificates/gencertificates.sh @@ -0,0 +1,54 @@ +#!/bin/sh + +# This script generates digital certificates of different types. + +#--- Certificates --------------------------------------------------------------------------- +echo -e "\ngenerating 1024-bit RSA private key to PEM file ..." +openssl genrsa -out rsa-pri-1024.pem 1024 + +echo -e "\ngenerating the corresponding public key to PEM and DER file ..." +openssl rsa -in rsa-pri-1024.pem -pubout -out rsa-pub-1024.pem +openssl rsa -in rsa-pri-1024.pem -pubout -out rsa-pub-1024.der -outform der + +echo -e "\ngenerating certificate signing request (CSR) ..." +openssl req -out req.pem -new -key rsa-pri-1024.pem -subj "/CN=name\/with\/slashes/C=NO" + +echo -e "\n generating a self-signed certifificate to PEM file ..." +openssl x509 -req -in req.pem -out cert-ss.pem -signkey rsa-pri-1024.pem + +echo -e "\n generating a self-signed certifificate to DER file ..." +openssl x509 -req -in req.pem -out cert-ss.der -signkey rsa-pri-1024.pem -outform der + +echo -e "\n generating a certifificate signed by a dummy CA to PEM file ..." +openssl x509 -req -in req.pem -out cert.pem -CA ca-cert.pem -set_serial 17 + +echo -e "\n generating a certifificate signed by a dummy CA to DER file ..." +openssl x509 -req -in req.pem -out cert.der -CA ca-cert.pem -set_serial 17 -outform der + +#--- Public keys -------------------------------------------------------------------------------- +echo -e "\n associate public keys with all certificates ..." +# Note: For now, there is only one public key (encoded in both PEM and DER), but that could change. +/bin/cp rsa-pub-1024.pem cert-ss.pem.pubkey +/bin/cp rsa-pub-1024.der cert-ss.der.pubkey +/bin/cp rsa-pub-1024.pem cert.pem.pubkey +/bin/cp rsa-pub-1024.der cert.der.pubkey + +#--- Digests -------------------------------------------------------------------------------- +echo -e "\n generating md5 and sha1 digests of all certificates ..." +for digest in md5 sha1 +do + openssl x509 -in ca-cert.pem -noout -fingerprint -$digest > ca-cert.pem.digest-$digest + openssl x509 -in cert-ss.pem -noout -fingerprint -$digest > cert-ss.pem.digest-$digest + openssl x509 -in cert.pem -noout -fingerprint -$digest > cert.pem.digest-$digest +done + +#--- Subjet Alternative Name extension ---------------------------------------------------- +echo -e "\n generating self signed root cert. with Subject Alternative Name extension (X509v3) ..." +outname=cert-ss-san.pem +openssl req -out req-san.pem -new -key rsa-pri-1024.pem -subj "/CN=Johnny GuitarC=NO" +openssl req -x509 -in req-san.pem -out $outname -key rsa-pri-1024.pem \ + -config san.cnf -extensions subj_alt_name +/bin/cp san.cnf $outname.san + +echo -e "\n cleaning up ..." +/bin/rm rsa-pri-1024.pem rsa-pub-1024.* req*.pem diff --git a/tests/auto/qsslcertificate/certificates/san.cnf b/tests/auto/qsslcertificate/certificates/san.cnf new file mode 100644 index 0000000..f46a637 --- /dev/null +++ b/tests/auto/qsslcertificate/certificates/san.cnf @@ -0,0 +1,5 @@ +[subj_alt_name] +subjectAltName=\ + email:arne@foobar.org,\ + DNS:www.foobar.org,\ + email:bjarne@foobar.org |