diff options
-rw-r--r-- | crypto/crypto.csproj | 32 | ||||
-rw-r--r-- | crypto/test/UnitTests.csproj | 8 | ||||
-rw-r--r-- | crypto/test/data/ThawteSGCCA.cer | bin | 0 -> 807 bytes | |||
-rw-r--r-- | crypto/test/data/ThawteSGCCA.crl | bin | 0 -> 55139 bytes | |||
-rw-r--r-- | crypto/test/data/cert_chain.data | 60 | ||||
-rw-r--r-- | crypto/test/data/cert_chain_nl.data | 59 | ||||
-rw-r--r-- | crypto/test/data/qvRooCa3.crt | 38 | ||||
-rw-r--r-- | crypto/test/data/suvaEE.crt | 32 | ||||
-rw-r--r-- | crypto/test/data/suvaEmail1.crt | 39 | ||||
-rw-r--r-- | crypto/test/data/suvaRoot1.crt | 46 | ||||
-rw-r--r-- | crypto/test/src/test/CertTest.cs | 84 |
11 files changed, 398 insertions, 0 deletions
diff --git a/crypto/crypto.csproj b/crypto/crypto.csproj index d48b2db5b..2f16fa08b 100644 --- a/crypto/crypto.csproj +++ b/crypto/crypto.csproj @@ -7529,6 +7529,38 @@ BuildAction = "Compile" /> <File + RelPath = "test\data\cert_chain.data" + BuildAction = "EmbeddedResource" + /> + <File + RelPath = "test\data\cert_chain_nl.data" + BuildAction = "EmbeddedResource" + /> + <File + RelPath = "test\data\qvRooCa3.crt" + BuildAction = "EmbeddedResource" + /> + <File + RelPath = "test\data\suvaEE.crt" + BuildAction = "EmbeddedResource" + /> + <File + RelPath = "test\data\suvaEmail1.crt" + BuildAction = "EmbeddedResource" + /> + <File + RelPath = "test\data\suvaRoot1.crt" + BuildAction = "EmbeddedResource" + /> + <File + RelPath = "test\data\ThawteSGCCA.cer" + BuildAction = "EmbeddedResource" + /> + <File + RelPath = "test\data\ThawteSGCCA.crl" + BuildAction = "EmbeddedResource" + /> + <File RelPath = "test\data\asn1\masterlist-content.data" BuildAction = "EmbeddedResource" /> diff --git a/crypto/test/UnitTests.csproj b/crypto/test/UnitTests.csproj index e9e0b3f4e..d4456b9c4 100644 --- a/crypto/test/UnitTests.csproj +++ b/crypto/test/UnitTests.csproj @@ -448,6 +448,14 @@ <Compile Include="src\x509\test\TestCertificateGen.cs" /> </ItemGroup> <ItemGroup> + <EmbeddedResource Include="data\cert_chain.data" /> + <EmbeddedResource Include="data\cert_chain_nl.data" /> + <EmbeddedResource Include="data\qvRooCa3.crt" /> + <EmbeddedResource Include="data\suvaEE.crt" /> + <EmbeddedResource Include="data\suvaEmail1.crt" /> + <EmbeddedResource Include="data\suvaRoot1.crt" /> + <EmbeddedResource Include="data\ThawteSGCCA.cer" /> + <EmbeddedResource Include="data\ThawteSGCCA.crl" /> <EmbeddedResource Include="data\crypto\SHA3TestVectors.txt" /> <EmbeddedResource Include="data\crypto\SHAKETestVectors.txt" /> <EmbeddedResource Include="data\PKITS\README.txt" /> diff --git a/crypto/test/data/ThawteSGCCA.cer b/crypto/test/data/ThawteSGCCA.cer new file mode 100644 index 000000000..14dfab308 --- /dev/null +++ b/crypto/test/data/ThawteSGCCA.cer Binary files differdiff --git a/crypto/test/data/ThawteSGCCA.crl b/crypto/test/data/ThawteSGCCA.crl new file mode 100644 index 000000000..06628261a --- /dev/null +++ b/crypto/test/data/ThawteSGCCA.crl Binary files differdiff --git a/crypto/test/data/cert_chain.data b/crypto/test/data/cert_chain.data new file mode 100644 index 000000000..00b56dd74 --- /dev/null +++ b/crypto/test/data/cert_chain.data @@ -0,0 +1,60 @@ +-----BEGIN CERTIFICATE----- +MIIE+TCCAuGgAwIBAgIVAIb1Te5/365tZJu71WN94Kh2FpSoMA0GCSqGSIb3DQEB +DQUAMBUxEzARBgNVBAsTClJvb3QgVEUgQ0EwHhcNMTUwNzAyMTU1MDA4WhcNMzUw +NzA3MTU1MDA4WjAvMRQwEgYDVQQDEwsxMC4yMTEuNTUuMzEXMBUGA1UECxMOVEUg +Uk1JIEhvc3QgQ0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCU85zq +Kwn80yW/QZjafyTnDiaPOr8X5u8OwTe+dbQPK2xS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9ATyIz+sgg7r9B3d4IduxPRCNm7+T7 +9dg9NokwUJwfJrKTXDC/OofBzsGYo9TTmIdjbe01ZD9va1U2VVm87N4+J+xDdsod +0eyp9CJ4z3ivm7NSplt56jYtkZ4J+kFzAIjU13zKxLVGqb0GTjISi1gwa5v5JGRX +RTz7zEv4FDJj5A9XuxDkAVNxeEn5cBqS2xDZQTpDAgMBAAGjJjAkMA4GA1UdDwEB +/wQEAwIBhjASBgNVHRMBAf8ECDAGAQH/AgECMA0GCSqGSIb3DQEBDQUAA4ICAQB/ +S9WHn3nBNl/PkRObDWIYutOI89IQQf9A7CRU2ndZH60Xy+eM59/CXbjU4vG2e9e6 +JcgrtSr6W+v+GLHCoVxOTI7IxM1+gjjLoHFfHNg97bXWRuHPLMSthTmSmiGC2q1r +fJ/cTfs2/+cJ8gzm2CZ0hKs3GrSxQezKZ+ZJBSC1wff8VT+8giALd76I7kvywC+u +4TnsoOzUCAC3mCR+laoIs8kmW+TBnZfgrskr0TjPdu5zCfZmK/SJSa8hOewYvrSc +mUmTQeAhR4NroT9fLrKlsQglIgckhp1KgUedcJp8HmWQcaRSWsAvy9WeQaftv9TQ +lWjEEjgdDwZ21qfl+o3wPAavC3il8pW8r8QWS5iFdzCpljYL3yfB5qbdhHfsEWD+ +oNWE4LCu+tq1PqgTNeSi1ff5RJCk3+sRJXDDK2Z6pCLhzUlmLSWlA1PmL3qLb3EM +dXdPmpsuevs3MFIxfUOiZ65BeKLCKjY87fr/Z4a3cwu9AZebv9K4/Nt07EOhbTCv +uAH7JcHDmRENPxUxrHIb/WIDhnPYUES+Vxr2oGVwSeNej9+22AGYxTgr7jY9A5Z4 +O+Sqfjbz818LTwYM+BTLGmHzRmgr85ygWpBwj9I2U+uEWKge2OksbCPQD9O3WJ+1 +DX9Bnr69S8ddGJVseNNtYsIvkE80HlyO+BqzASvuXQ== +-----END CERTIFICATE----- + + diff --git a/crypto/test/data/cert_chain_nl.data b/crypto/test/data/cert_chain_nl.data new file mode 100644 index 000000000..feebf75af --- /dev/null +++ b/crypto/test/data/cert_chain_nl.data @@ -0,0 +1,59 @@ +-----BEGIN CERTIFICATE----- +MIIE+TCCAuGgAwIBAgIVAIb1Te5/365tZJu71WN94Kh2FpSoMA0GCSqGSIb3DQEB +DQUAMBUxEzARBgNVBAsTClJvb3QgVEUgQ0EwHhcNMTUwNzAyMTU1MDA4WhcNMzUw +NzA3MTU1MDA4WjAvMRQwEgYDVQQDEwsxMC4yMTEuNTUuMzEXMBUGA1UECxMOVEUg +Uk1JIEhvc3QgQ0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCU85zq +Kwn80yW/QZjafyTnDiaPOr8X5u8OwTe+dbQPK2xSdT7d6FqEM8rmY9njGhue5XLH +xKcUweVMt6E9h581qMrf39sldWMyoHxZiquPfs0t3zfMa3hYF5AONH5I3zdTZQj4 ++5SD0mJugeM7YQ6eRs8qBdKLN/FwRWRAWQwDe3gF1gW5mgXfuo4Z3ufVscbJziJr +L9gnYaqCfmI8MaDWeDNkB9biTYPXGh0oacUSpWUHyyrTlzodaKhd+m5FAgDUFlV4 +I9iv7YO4DT9sJmxmNFMrTN+c5HZjl1QL9J74HED1B1emWvxOAQvMuSfnBkR8G70E +D9qd1YnrEmM84FRrYgGtC2POJGnE25Fpvb/DZOuZXpFFTvQ5yuTJqcWLEgPZu45P +2Wigpf1j523dkA15kwhY8+r58HTCULAsqfHedrFz1YXF8BXzecH7SzpXH2hlA36m +oEGjFXrqAQe9YfLGLRnUrNgC12DWX2UzTqMuM5Q8Byj8SIE2oBkKXb5aW1zXkkJX +U2pzzIglljQB8kjpkw4zTzZpEeoJwAMAQ4K73TkkV9YQOEdVJvqWYz5gWQI17qbm +2gwrkYtA50+vhuO0wrIi9cJMZBOm46owBVDcMdDePgC5SURvnNjH+j1sx23IINXV +ipViuv9t+YLNqO+8cPaAz225Yg7snCBnOO3RGwIDAQABoyYwJDAOBgNVHQ8BAf8E +BAMCAYYwEgYDVR0TAQH/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oNWE4LCu+tq1PqgTNeSi1ff5RJCk3+sRJXDDK2Z6pCLhzUlmLSWlA1PmL3qLb3EM +dXdPmpsuevs3MFIxfUOiZ65BeKLCKjY87fr/Z4a3cwu9AZebv9K4/Nt07EOhbTCv +uAH7JcHDmRENPxUxrHIb/WIDhnPYUES+Vxr2oGVwSeNej9+22AGYxTgr7jY9A5Z4 +O+Sqfjbz818LTwYM+BTLGmHzRmgr85ygWpBwj9I2U+uEWKge2OksbCPQD9O3WJ+1 +DX9Bnr69S8ddGJVseNNtYsIvkE80HlyO+BqzASvuXQ== +-----END CERTIFICATE----- + + diff --git a/crypto/test/data/qvRooCa3.crt b/crypto/test/data/qvRooCa3.crt new file mode 100644 index 000000000..969322b95 --- /dev/null +++ b/crypto/test/data/qvRooCa3.crt @@ -0,0 +1,38 @@ +-----BEGIN CERTIFICATE----- +MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0x +GTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJv +b3QgQ0EgMzAeFw0wNjExMjQxOTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNV +BAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMRswGQYDVQQDExJRdW9W +YWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDM +V0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNggDhoB +4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUr +H556VOijKTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd +8lyyBTNvijbO0BNO/79KDDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9Cabwv +vWhDFlaJKjdhkf2mrk7AyxRllDdLkg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QRiSem +d1o417+shvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd ++LJ2w/w4E6oM3kJpK27zPOuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B +4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadN +t54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp8kokUvd0/bpO5qgdAm6x +DYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBCbjPsMZ57 +k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6s +zHXug/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0j +Wy10QJLZYxkNc91pvGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeT +mJlglFwjz1onl14LBQaTNx47aTbrqZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK +4SVhM7JZG+Ju1zdXtg2pEto= +-----END CERTIFICATE----- diff --git a/crypto/test/data/suvaEE.crt b/crypto/test/data/suvaEE.crt new file mode 100644 index 000000000..cc8e8ac8a --- /dev/null +++ b/crypto/test/data/suvaEE.crt @@ -0,0 +1,32 @@ +-----BEGIN CERTIFICATE----- +MIIFfjCCA2agAwIBAgIIBHTrx4eZAPkwDQYJKoZIhvcNAQEFBQAwcDELMAkGA1UE +BhMCQ0gxDzANBgNVBAgTBkx1emVybjEPMA0GA1UEBxMGTHV6ZXJuMQ0wCwYDVQQK +EwRTdXZhMQswCQYDVQQLEwJJRjEjMCEGA1UEAxMaU3V2YSBTZWN1cmUgTWFpbCBJ +Q0EgMSAoMSkwHhcNMTQwODA0MTE0OTIxWhcNMTYwODAzMTI0OTIxWjCBhTELMAkG +A1UEBhMCQ0gxDzANBgNVBAgMBkx1emVybjEP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Qb0XKl5K4xWDcn5wKdcA7UZsLW2guZm7LiWuPYiNVk5QXg3Z9awZfquFGXw +1uOCfhIv5IlfVwXf94kok6sy3tnk3IDuYLBfaAVHpAMgyocgn1XU/aAy7y+bUUHe +AosKkV6AZ/5pirZv8yDuB37sIEAiOfMc3cCYk/ACbw+C18XcGXUKxWNBG+LUiJ/n +lvxnqCWOAS4/U52I0bmbXYMZ9Iz8dYoMe19iG2sQHMhw4S25O/oKhllzmren1BNd +EA/EZdbmqjmGDfvY6ELQpyeTUz6u/4Hfcdd/8IavcYXfBo0kpPJFm6epjMBSw2Bi +D1r1U+8oGNwoTce++Ch30eEjuxyMFTDOXzJObJHsZmcPP1fxKch5yGX+cF2oDWju +GOvviu9YxVTC4m+vwAwmmKSl7XylrVcJmXCh7u92wvgw8kXqA0R/P/gn8QQtQ5Ge +/a6vJRyhDVEP8wWmyebLZYlHZDrosD191d92SKaMRg7HDAH0nZ6wtlgxD20JyDO0 +FIIJq/d36mNrHPbd7Y4SxiAX +-----END CERTIFICATE----- diff --git a/crypto/test/data/suvaEmail1.crt b/crypto/test/data/suvaEmail1.crt new file mode 100644 index 000000000..a7bcfdd6c --- /dev/null +++ b/crypto/test/data/suvaEmail1.crt @@ -0,0 +1,39 @@ +-----BEGIN CERTIFICATE----- +MIIG5DCCBMygAwIBAgIKF/12kwABAAACGDANBgkqhkiG9w0BAQUFADBGMQswCQYD +VQQGEwJDSDEPMA0GA1UECBMGTHV6ZXJuMQ0wCwYDVQQKEwRTdXZhMRcwFQYDVQQD +Ew5TdXZhIFJvb3QgQ0EgMTAeFw0xNDA1MTcwODAwNDJaFw0yNDA1MDcxMzEyMDNa +MHAxCzAJBgNVBAYTAkNIMQ8wDQYDVQQIEwZMdXplcm4xDzANBgNVBAcTBkx1emVy +bjENMAsGA1UEChMEU3V2YTELMAkGA1UECxMCSUYxIzAhBgNVBAMTGlN1dmEgU2Vj +dXJlIE1haWwgSUNBIDEgKDEpMIICIDANBgkqhkiG9w0BAQEF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2NydC9TdXZhJTIwUm9vdCUyMENBJTIwMSgxKS5jcnQwPAYJ +KwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIxZdWhpShU4LRlzCD+65khNfBO0aHve1v +hcKqLQIBZAIBBzAeBgNVHSUEFzAVBggrBgEFBQcDBAYJKwYBBAGCNxUFMCgGCSsG +AQQBgjcVCgQbMBkwCgYIKwYBBQUHAwQwCwYJKwYBBAGCNxUFMA0GCSqGSIb3DQEB +BQUAA4ICAQDeAhIR0DCUS4tHJCJAPgHH/uMQcgV3qKNkZznmaKQ0kRl2JISbojrv +6WnIr+gcyoBPbI01QNbe7Dh73mMK/ezUZ04B9z9UBUvV5l7rCOL28Hnz/zmZZX+T +q3jxtQJPV4w2b9tuo8/vEUirEySmkmN6IGbu1epAhp9mCKUNjC6Oe3JwsMX/ouZN +Op2PPQ82fjVk8zlUpVX9qfRc9XmW992JrUe/npWqdJYYSJY1vFB9b6gMGiwOms1H +oXuDz0BQXp0m0D+7VjY8qi8vN7N8/Zy6EC/453ogal20nhMEiihGkvD68RyBjQO6 +kEWcjUizcC0vjcH6W+EyQeJ5VDTxv/GlSA2SHZWFJ7/T1dY+bHBjHr7aqptQzZeU +cWv0BfFdlEMkzZgOLRrmHKdTCGa/11vi3T12SzISwyGakPKrA8IaJCzNQO3/6dc8 +DBX8p9RO54VrSDsDSfTueofMnBpUJABMe1Eohqsj0sZv0n8cK85A6utQPuSxmgV2 +IAXdJMJcGAZ6PDKKCJYVVdHOeFEdUMh/fh6QGd1Iz0QMfMeiZODTo92loHnW0HPL +aVTdoQmn3K1yVFUrdYp/OJz4UDWFb2k4Du6GeQl1jqc2VREPohvvbDSJ9pgE3Oh2 +DEN7RZ7zK/FwLZeo8Qgo4yguznSzp3zLrUwLTewRNU1QbEiy9tIclQ== +-----END CERTIFICATE----- diff --git a/crypto/test/data/suvaRoot1.crt b/crypto/test/data/suvaRoot1.crt new file mode 100644 index 000000000..83cfe6686 --- /dev/null +++ b/crypto/test/data/suvaRo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5s3NPn/qpua22SUyH +sujqy8vHEAOS0KPbN+Jnq4KpexylTVHQ3ybgHSQt6SZ+/NSBHO8eAAyqZyWjenyk +UCcL7TNO82tD7lkuq+eo+BIsq9AJTI0gGRqG/wFyvNpVssZ0bFdqGNq0aM74NHWD +7LRa6toC1I+YNpvelSlZvGfEpm0G7e04AE3kzFnaemG3RwRY2mUtT5Aby5vpfouh +IbdF4t1NEyC9ExFOkEjZ3P1AAoJgxQC3T7B1Mo6r03pcBdd9LrjjVJidUyj+j/ha +faZo4e1wJeU09UtzVSzGb1GA8QHOJMY7VeA0qLg4qfZdeoDxrCZJKn/pZP2D6dQs +0Za1args4EUJmdVFsuFNc1DsM1EXTD5o9dHkX/cKPv6eMRehP7emNjJgmcIv1rX3 +sotSJA06D+5LW6ZkuWdS2uArCta8YgrVtefRMNj2nhVGafLt7tE819E0fqnaknGR +RgfNRFEMeTIU29RtgvzbpYtCK+O1v7a3x55mt/RbMhtruns3OOVAY+l7nW1y51Xb +A8bPOZc7fREndSacNCpK37Or3AhE4Uneylz+rN25H2hL8OT/xAXxj6IcPRuD2SDH +nvXiM0xeqCQpfDNv/35uNSMdpsA75GZwRpvt0fMc5r0AwtwBFZX7X4KtULoNxLNb +JZxATf23 +-----END CERTIFICATE----- + diff --git a/crypto/test/src/test/CertTest.cs b/crypto/test/src/test/CertTest.cs index 72e17e458..d9af06c82 100644 --- a/crypto/test/src/test/CertTest.cs +++ b/crypto/test/src/test/CertTest.cs @@ -19,6 +19,7 @@ using Org.BouncyCastle.Security; using Org.BouncyCastle.Security.Certificates; using Org.BouncyCastle.Utilities.Collections; using Org.BouncyCastle.Utilities.Encoders; +using Org.BouncyCastle.Utilities.IO; using Org.BouncyCastle.Utilities.Test; using Org.BouncyCastle.X509; using Org.BouncyCastle.X509.Extension; @@ -2426,6 +2427,19 @@ namespace Org.BouncyCastle.Tests return new AsymmetricCipherKeyPair(pubKey, privKey); } + private void rfc4491Test() + { + X509CertificateParser certFact = new X509CertificateParser(); + + X509Certificate x509 = certFact.ReadCertificate(new MemoryStream(gostRFC4491_94, false)); + + x509.Verify(x509.GetPublicKey()); + + x509 = (X509Certificate)certFact.ReadCertificate(new MemoryStream(gostRFC4491_2001, false)); + + x509.Verify(x509.GetPublicKey()); + } + private void doTestNullDerNullCert() { AsymmetricCipherKeyPair keyPair = GenerateLongFixedKeys(); @@ -2469,6 +2483,71 @@ namespace Org.BouncyCastle.Tests } } + private void pemFileTest() + { + X509CertificateParser fact = new X509CertificateParser(); + + ICollection certs1 = fact.ReadCertificates(GetTestDataAsStream("cert_chain.data")); + IsTrue("certs wrong <cr><nl>", 2 == certs1.Count); + + MemoryStream input = new MemoryStream(Streams.ReadAll(GetTestDataAsStream("cert_chain.data")), false); + + ISet certs2 = new HashSet(); + while (input.Position < input.Length) + { + X509Certificate c = fact.ReadCertificate(input); + + // this isn't strictly correct with the way it's defined in the Java JavaDoc - need it for backward + // compatibility. + if (c != null) + { + certs2.Add(c); + } + } + IsTrue("certs size <cr><nl>", certs1.Count == certs2.Count); + + certs2.RemoveAll(certs1); + IsTrue("collection not empty", certs2.Count == 0); + } + + private void invalidCrls() + { + X509CrlParser crlParser = new X509CrlParser(); + + ICollection crls = crlParser.ReadCrls(GetTestDataAsStream("cert_chain.data")); + IsTrue("multi crl", crls.Count == 0); + + X509Crl crl = crlParser.ReadCrl(GetTestDataAsStream("cert_chain.data")); + IsTrue("single crl", crl == null); + } + + private void pemFileTestWithNl() + { + X509CertificateParser fact = new X509CertificateParser(); + + ICollection certs1 = fact.ReadCertificates(GetTestDataAsStream("cert_chain_nl.data")); + IsTrue("certs wrong <nl>", 2 == certs1.Count); + + MemoryStream input = new MemoryStream(Streams.ReadAll(GetTestDataAsStream("cert_chain_nl.data")), false); + + ISet certs2 = new HashSet(); + while (input.Position < input.Length) + { + X509Certificate c = fact.ReadCertificate(input); + + // this isn't strictly correct with the way it's defined in the Java JavaDoc - need it for backward + // compatibility. + if (c != null) + { + certs2.Add(c); + } + } + IsTrue("certs size <nl>", certs1.Count == certs2.Count); + + certs2.RemoveAll(certs1); + IsTrue("collection not empty", certs2.Count == 0); + } + public override void PerformTest() { checkCertificate(1, cert1); @@ -2518,7 +2597,12 @@ namespace Org.BouncyCastle.Tests checkCrlCreation3(); pemTest(); + pemFileTest(); + pemFileTestWithNl(); pkcs7Test(); + rfc4491Test(); + + invalidCrls(); doTestForgedSignature(); |