public async Task GetById_IncorrectId_ReturnsKey()
        {
            var dummyKey = new JsonWebKeyStub(Guid.NewGuid());
            await m_publicKeyDataProvider.SaveAsync(dummyKey).SafeAsync();

            var key = await m_publicKeyDataProvider.GetByIdAsync(Guid.NewGuid()).SafeAsync();

            Assert.IsNull(key);
        }
        public async Task GetById_IncorrectId_ReturnsKey()
        {
            var id       = Guid.NewGuid();
            var dummyKey = new JsonWebKeyStub(id.ToString());
            await m_publicKeyDataProvider.SaveAsync(id, dummyKey).ConfigureAwait(false);

            var key = await m_publicKeyDataProvider.GetByIdAsync(Guid.NewGuid()).ConfigureAwait(false);

            Assert.IsNull(key);
        }
        async Task <D2LSecurityToken> IPrivateKeyProvider.GetSigningCredentialsAsync()
        {
            D2LSecurityToken result = await m_inner.GetSigningCredentialsAsync().SafeAsync();

            JsonWebKey jwk = result.ToJsonWebKey();

            await m_publicKeyDataProvider.SaveAsync(jwk).SafeAsync();

            return(result);
        }
Exemplo n.º 4
0
        async Task <D2LSecurityToken> IPrivateKeyProvider.GetSigningCredentialsAsync()
        {
            D2LSecurityToken result = await m_inner.GetSigningCredentialsAsync().ConfigureAwait(false);

            JsonWebKey jwk = result.ToJsonWebKey();

            await m_publicKeyDataProvider.SaveAsync(new Guid( jwk.Id ), jwk).ConfigureAwait(false);

            return(result);
        }
Exemplo n.º 5
0
 Task IPublicKeyDataProvider.SaveAsync(JsonWebKey key)
 {
     return(m_inner.SaveAsync(key));
 }
 Task IPublicKeyDataProvider.SaveAsync(Guid id, JsonWebKey key)
 {
     return(m_inner.SaveAsync(id, key));
 }