コード例 #1
0
ファイル: FolaighKeyStoreTest.cs プロジェクト: flann/Folaigh
        private FolaighKeyGenerator generateKeys()
        {
            FolaighKeyGenerator keyGenerator = new FolaighKeyGenerator();

            keyGenerator.KeySize   = 1024;
            keyGenerator.Certainty = 8;
            keyGenerator.createKeyPair("US", "Karmashave", "Salt Lake City",
                                       "Utah", EMAIL_ADDRESS, "Foo");
            return(keyGenerator);
        }
コード例 #2
0
        public void testGenerateKeyPair()
        {
            string country         = "US";
            string organization    = "KarmaShave";
            string locality        = "Salt Lake City";
            string stateOrProvince = "Utah";
            string emailAddress    = "*****@*****.**";
            string commonName      = "Terry";

            FolaighKeyGenerator keyGenerator = new FolaighKeyGenerator();

            Assert.IsNull(keyGenerator.Certificate);
            Assert.IsNull(keyGenerator.PrivateKey);
            keyGenerator.KeySize   = 1024;
            keyGenerator.Certainty = 8;
            keyGenerator.createKeyPair(country, organization, locality, stateOrProvince, emailAddress, commonName);
            Assert.IsNotNull(keyGenerator.Certificate.GetType());
            Assert.IsNotNull(keyGenerator.PrivateKey);
        }