diff options
Diffstat (limited to 'crypto/test')
-rw-r--r-- | crypto/test/data/jks/cacerts.jks | bin | 0 -> 156996 bytes | |||
-rw-r--r-- | crypto/test/src/security/test/JksStoreTest.cs | 16 |
2 files changed, 16 insertions, 0 deletions
diff --git a/crypto/test/data/jks/cacerts.jks b/crypto/test/data/jks/cacerts.jks new file mode 100644 index 000000000..ca0cbd33e --- /dev/null +++ b/crypto/test/data/jks/cacerts.jks Binary files differdiff --git a/crypto/test/src/security/test/JksStoreTest.cs b/crypto/test/src/security/test/JksStoreTest.cs index 335786f5e..8794d48a6 100644 --- a/crypto/test/src/security/test/JksStoreTest.cs +++ b/crypto/test/src/security/test/JksStoreTest.cs @@ -9,6 +9,8 @@ using Org.BouncyCastle.Crypto.Parameters; using Org.BouncyCastle.Math; using Org.BouncyCastle.Utilities.Encoders; +using Org.BouncyCastle.Utilities.Test; + namespace Org.BouncyCastle.Security.Tests { [TestFixture] @@ -177,5 +179,19 @@ namespace Org.BouncyCastle.Security.Tests // Expected } } + + [Test] + public void TestJksModifiedUtf8Roundtrip() + { + JksStore ks = new JksStore(); + Stream fIn = SimpleTest.GetTestDataAsStream("jks.cacerts.jks"); + + ks.Load(fIn, "changeit".ToCharArray()); + + MemoryStream bOut = new MemoryStream(); + ks.Save(bOut, "changedit".ToCharArray()); + + ks.Load(new MemoryStream(bOut.ToArray()), "changedit".ToCharArray()); + } } } |