Exemplo n.º 1
0
        public JwtBuilder Build()
        {
            RSA rsaKey = _oidcKeyManager.GetKey();

            return(new JwtBuilder()
                   .WithAlgorithm(new RS256Algorithm(rsaKey, rsaKey)));
        }
Exemplo n.º 2
0
        public void TestGetKey()
        {
            using (var transaction = Fixture.Connection.BeginTransaction())
            {
                using (var context = Fixture.CreateContext(transaction))
                {
                    ConfigurationProvider provider = new ConfigurationProvider(context);
                    OIDCKeyManager        manager  = new OIDCKeyManager(provider);

                    RSA initialKeyLoading = manager.GetKey();
                    RSA secondKeyLoading  = manager.GetKey();

                    Assert.Equal(initialKeyLoading.ToXmlString(true), secondKeyLoading.ToXmlString(true));
                    Assert.Equal(2048, initialKeyLoading.KeySize);
                }
            }
        }