public Task <IEnumerable <SecurityKeyInfo> > GetValidationKeysAsync() { var keyInfo = new List <SecurityKeyInfo> { _keyPairManagerService.GetNextKey().SecurityKeyInfo }; if (_keyPairManagerService.GetLastKey() != null) { keyInfo.Add(_keyPairManagerService.GetLastKey().SecurityKeyInfo); } return(Task.FromResult(keyInfo.AsEnumerable())); }
public IActionResult GetAll() { var lastKey = _jsonWebKeyManagerService.GetLastKey()?.PublicKey; var currentKey = _jsonWebKeyManagerService.GetCurrentKey().PublicKey; var nextKey = _jsonWebKeyManagerService.GetNextKey().PublicKey; var retVal = new List <JsonWebKey>(); if (lastKey != null) { retVal.Add(lastKey); } retVal.AddRange(new [] { currentKey, nextKey }); return(Ok(retVal)); }