예제 #1
0
        private void SetupWithInMemoryKeyStores()
        {
            var publicKeyStore = new InMemoryPublicKeyStore();

            _publicKey = publicKeyStore.GetAsync().GetAwaiter().GetResult();

            var privateKeyStore = new InMemoryPrivateKeyStore();

            _privateKey = privateKeyStore.GetAsync().GetAwaiter().GetResult();
        }
예제 #2
0
        public ProtocolTests()
        {
            // Import parameters for the elliptic curve prime256v1
            _ecParameters = CustomNamedCurves.GetByOid(X9ObjectIdentifiers.Prime256v1);

            var publicKeyStore = new InMemoryPublicKeyStore();

            _publicKey = publicKeyStore.GetAsync().GetAwaiter().GetResult();

            var privateKeyStore = new InMemoryPrivateKeyStore();

            _privateKey      = privateKeyStore.GetAsync().GetAwaiter().GetResult();
            _wrongPrivateKey = _privateKey.Add(BigInteger.One);

            _initiator      = new Initiator();
            _tokenGenerator = new TokenGenerator();
            _tokenVerifier  = new TokenVerifier(new InMemorySeedStore());
        }