public async Task IsValidAsync_UntrustedRootAndProductionStrategy_ReturnsFalse() { var args = CreateValidArgs(); var sut = new JwtCertificateValidator( _partiesQueryServiceMock.Object, _trustedListQueryServiceMock.Object, new ProductionCaStrategy(), _loggerMock.Object); var result = await sut.IsValidAsync(args, "access_token", CancellationToken.None); result.Should().BeFalse(); }
public async Task IsValidAsync_ValidAndTrusted_ReturnsTrue() { var sut = new JwtCertificateValidator( _partiesQueryServiceMock.Object, _trustedListQueryServiceMock.Object, new ProductionCaStrategy(), _loggerMock.Object); var args = new CertificateValidationArgs( CertificateUtilities.FromBase64Der(Constants.TrustedCertificates.PublicKeyBase64Der), Constants.SchemeOwner.ClientId, new[] { CertificateUtilities.FromBase64Der(Constants.TrustedCertificates.RootCaPublicKeyBase64Der) }); var result = await sut.IsValidAsync(args, "access_token", CancellationToken.None); result.Should().BeTrue(); }