Beispiel #1
0
        public void DecodeSecretKey()
        {
            var          keyMaster = new KeyMaster();
            const string KeyString =
                "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCb1TXuuj1RESupASrVzk0U51oIPRaZVfdWPZo/VOljHTcfNl1/boHsp+IylC/tcVP9MYwiD5IQye78MjOQZ72rpJZMirmjE1P3mrckDFg1MexxsGn6/JRWWgh/AuN2T4/qkv5FXQvBxtLiaH9p4iV6lgCcTPEWZYMbpF4oiL4FwwIDAQAB";
            SecretKey sk = keyMaster.DecodeSecretKey(KeyString);

            Assert.IsNotNull(sk);
            Assert.IsNotNull(sk.GetBytes());
        }
Beispiel #2
0
        public void EncodeDecodeSecretKey()
        {
            var       keyMaster = new KeyMaster();
            SecretKey sk        = keyMaster.GenerateSecretKey();
            string    encoded   = keyMaster.EncodeSecretKey(sk);

            Assert.IsNotNull(encoded);

            SecretKey sk2 = keyMaster.DecodeSecretKey(encoded);

            Assert.IsNotNull(sk2);
            Assert.AreEqual(sk, sk2);
        }