public void TestFullProtocolFromSecKeyGcm() { Assert.IsTrue(ScpConfigHelper.TryLoad("test.secKey.json", out ScpConfig config)); Assert.IsTrue(config.TryGetECDsaKey(out ECDsaCng key, "SecretariumTestClient256")); config.encryptionMode = ScpConfig.EncryptionMode.AESGCM; using (var scp = new SecureConnectionProtocol()) { scp.Init(config); scp.Set(key); var connected = scp.Connect(20000); Assert.IsTrue(connected); } }
public void TestFullProtocolFromSecKeyCtr() { Assert.IsTrue(ScpConfigHelper.TryLoad("test.secKey.json", out ScpConfig config)); Assert.IsTrue(config.secretariumKey.TryGetECDsaKeys("SecretariumTestClient256", out byte[] publicKeyRaw, out byte[] privateKeyRaw)); var key = ECDsaHelper.ImportPrivateKey(publicKeyRaw, privateKeyRaw); Assert.NotNull(key); using (var scp = new SecureConnectionProtocol()) { scp.Init(config); scp.Set(key); var connected = scp.Connect(20000); Assert.IsTrue(connected); } }
public void AutoOpen() { Logger.InfoFormat(@"Starting"); // Config _config = new ScpConfig { client = new ScpConfig.ClientConfig { proofOfWorkMaxDifficulty = 18 }, secretarium = new ScpConfig.SecretariumConfig { endPoint = "wss://ovh1.node.secretarium.org:443/", knownPubKey = "rliD_CISqPEeYKbWYdwa-L-8oytAPvdGmbLC0KdvsH-OVMraarm1eo-q4fte0cWJ7-kmsq8wekFIJK0a83_yCg==" } }; Scp.Init(_config); Logger.InfoFormat(@"Starting with endpoint:{0} and trustedley:{1}", _config.secretarium.endPoint, _config.secretarium.knownPubKey); }