|
|
@ -42,7 +42,7 @@ namespace iText.Signatures { |
|
|
|
|
|
|
|
private const String SIG_FIELD_NAME = "Signature1"; |
|
|
|
|
|
|
|
private const String CRL_DISTRIBUTION_POINT = "https://example.com"; |
|
|
|
private const String CRL_DISTRIBUTION_POINT = "https://itextpdf.com"; |
|
|
|
|
|
|
|
private static readonly String CERT_FOLDER_PATH = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext |
|
|
|
.CurrentContext.TestDirectory) + "/resources/itext/signatures/certs/"; |
|
|
@ -312,136 +312,136 @@ namespace iText.Signatures { |
|
|
|
} |
|
|
|
|
|
|
|
[NUnit.Framework.Test] |
|
|
|
[LogMessage("Added CRL url: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Checking CRL: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Added CRL found at: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Added CRL url: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Checking CRL: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Added CRL found at: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
public virtual void ValidateSigNameSigningOcspCrlYesTest() { |
|
|
|
ValidateOptionLevelInclusion(CRL_DISTRIBUTION_POINT, LtvVerification.CertificateOption.SIGNING_CERTIFICATE |
|
|
|
, LtvVerification.Level.OCSP_CRL, LtvVerification.CertificateInclusion.YES, true); |
|
|
|
} |
|
|
|
|
|
|
|
[NUnit.Framework.Test] |
|
|
|
[LogMessage("Added CRL url: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Added CRL url: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
public virtual void ValidateSigNameSigningOcspYesTest() { |
|
|
|
ValidateOptionLevelInclusion(CRL_DISTRIBUTION_POINT, LtvVerification.CertificateOption.SIGNING_CERTIFICATE |
|
|
|
, LtvVerification.Level.OCSP, LtvVerification.CertificateInclusion.YES, false); |
|
|
|
} |
|
|
|
|
|
|
|
[NUnit.Framework.Test] |
|
|
|
[LogMessage("Added CRL url: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Checking CRL: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Added CRL found at: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Added CRL url: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Checking CRL: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Added CRL found at: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
public virtual void ValidateSigNameSigningCrlYesTest() { |
|
|
|
ValidateOptionLevelInclusion(CRL_DISTRIBUTION_POINT, LtvVerification.CertificateOption.SIGNING_CERTIFICATE |
|
|
|
, LtvVerification.Level.CRL, LtvVerification.CertificateInclusion.YES, true); |
|
|
|
} |
|
|
|
|
|
|
|
[NUnit.Framework.Test] |
|
|
|
[LogMessage("Added CRL url: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Checking CRL: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Added CRL found at: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Added CRL url: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Checking CRL: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Added CRL found at: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
public virtual void ValidateSigNameSigningOcspOptionalCrlYesTest() { |
|
|
|
ValidateOptionLevelInclusion(CRL_DISTRIBUTION_POINT, LtvVerification.CertificateOption.SIGNING_CERTIFICATE |
|
|
|
, LtvVerification.Level.OCSP_OPTIONAL_CRL, LtvVerification.CertificateInclusion.YES, true); |
|
|
|
} |
|
|
|
|
|
|
|
[NUnit.Framework.Test] |
|
|
|
[LogMessage("Added CRL url: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Checking CRL: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Added CRL found at: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Added CRL url: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Checking CRL: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Added CRL found at: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
public virtual void ValidateSigNameSigningOcspCrlNoTest() { |
|
|
|
ValidateOptionLevelInclusion(CRL_DISTRIBUTION_POINT, LtvVerification.CertificateOption.SIGNING_CERTIFICATE |
|
|
|
, LtvVerification.Level.OCSP_CRL, LtvVerification.CertificateInclusion.NO, true); |
|
|
|
} |
|
|
|
|
|
|
|
[NUnit.Framework.Test] |
|
|
|
[LogMessage("Added CRL url: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Added CRL url: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
public virtual void ValidateSigNameSigningOcspNoTest() { |
|
|
|
ValidateOptionLevelInclusion(CRL_DISTRIBUTION_POINT, LtvVerification.CertificateOption.SIGNING_CERTIFICATE |
|
|
|
, LtvVerification.Level.OCSP, LtvVerification.CertificateInclusion.NO, false); |
|
|
|
} |
|
|
|
|
|
|
|
[NUnit.Framework.Test] |
|
|
|
[LogMessage("Added CRL url: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Checking CRL: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Added CRL found at: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Added CRL url: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Checking CRL: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Added CRL found at: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
public virtual void ValidateSigNameSigningCrlNoTest() { |
|
|
|
ValidateOptionLevelInclusion(CRL_DISTRIBUTION_POINT, LtvVerification.CertificateOption.SIGNING_CERTIFICATE |
|
|
|
, LtvVerification.Level.CRL, LtvVerification.CertificateInclusion.NO, true); |
|
|
|
} |
|
|
|
|
|
|
|
[NUnit.Framework.Test] |
|
|
|
[LogMessage("Added CRL url: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Checking CRL: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Added CRL found at: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Added CRL url: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Checking CRL: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Added CRL found at: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
public virtual void ValidateSigNameSigningOcspOptionalCrlNoTest() { |
|
|
|
ValidateOptionLevelInclusion(CRL_DISTRIBUTION_POINT, LtvVerification.CertificateOption.SIGNING_CERTIFICATE |
|
|
|
, LtvVerification.Level.OCSP_OPTIONAL_CRL, LtvVerification.CertificateInclusion.NO, true); |
|
|
|
} |
|
|
|
|
|
|
|
[NUnit.Framework.Test] |
|
|
|
[LogMessage("Added CRL url: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Checking CRL: https://example.com", LogLevel = LogLevelConstants.INFO, Count = 2)] |
|
|
|
[LogMessage("Added CRL found at: https://example.com", LogLevel = LogLevelConstants.INFO, Count = 2)] |
|
|
|
[LogMessage("Added CRL url: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Checking CRL: https://itextpdf.com", LogLevel = LogLevelConstants.INFO, Count = 2)] |
|
|
|
[LogMessage("Added CRL found at: https://itextpdf.com", LogLevel = LogLevelConstants.INFO, Count = 2)] |
|
|
|
public virtual void ValidateSigNameWholeChainOcspCrlYesTest() { |
|
|
|
ValidateOptionLevelInclusion(CRL_DISTRIBUTION_POINT, LtvVerification.CertificateOption.WHOLE_CHAIN, LtvVerification.Level |
|
|
|
.OCSP_CRL, LtvVerification.CertificateInclusion.YES, true); |
|
|
|
} |
|
|
|
|
|
|
|
[NUnit.Framework.Test] |
|
|
|
[LogMessage("Added CRL url: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Checking CRL: https://example.com", LogLevel = LogLevelConstants.INFO, Count = 2)] |
|
|
|
[LogMessage("Added CRL found at: https://example.com", LogLevel = LogLevelConstants.INFO, Count = 2)] |
|
|
|
[LogMessage("Added CRL url: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Checking CRL: https://itextpdf.com", LogLevel = LogLevelConstants.INFO, Count = 2)] |
|
|
|
[LogMessage("Added CRL found at: https://itextpdf.com", LogLevel = LogLevelConstants.INFO, Count = 2)] |
|
|
|
public virtual void ValidateSigNameWholeChainOcspOptionalCrlYesTest() { |
|
|
|
ValidateOptionLevelInclusion(CRL_DISTRIBUTION_POINT, LtvVerification.CertificateOption.WHOLE_CHAIN, LtvVerification.Level |
|
|
|
.OCSP_OPTIONAL_CRL, LtvVerification.CertificateInclusion.YES, true); |
|
|
|
} |
|
|
|
|
|
|
|
[NUnit.Framework.Test] |
|
|
|
[LogMessage("Added CRL url: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Added CRL url: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
public virtual void ValidateSigNameWholeChainOcspYesTest() { |
|
|
|
ValidateOptionLevelInclusion(CRL_DISTRIBUTION_POINT, LtvVerification.CertificateOption.WHOLE_CHAIN, LtvVerification.Level |
|
|
|
.OCSP, LtvVerification.CertificateInclusion.YES, false); |
|
|
|
} |
|
|
|
|
|
|
|
[NUnit.Framework.Test] |
|
|
|
[LogMessage("Added CRL url: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Checking CRL: https://example.com", LogLevel = LogLevelConstants.INFO, Count = 2)] |
|
|
|
[LogMessage("Added CRL found at: https://example.com", LogLevel = LogLevelConstants.INFO, Count = 2)] |
|
|
|
[LogMessage("Added CRL url: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Checking CRL: https://itextpdf.com", LogLevel = LogLevelConstants.INFO, Count = 2)] |
|
|
|
[LogMessage("Added CRL found at: https://itextpdf.com", LogLevel = LogLevelConstants.INFO, Count = 2)] |
|
|
|
public virtual void ValidateSigNameWholeChainCrlYesTest() { |
|
|
|
ValidateOptionLevelInclusion(CRL_DISTRIBUTION_POINT, LtvVerification.CertificateOption.WHOLE_CHAIN, LtvVerification.Level |
|
|
|
.CRL, LtvVerification.CertificateInclusion.YES, true); |
|
|
|
} |
|
|
|
|
|
|
|
[NUnit.Framework.Test] |
|
|
|
[LogMessage("Added CRL url: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Checking CRL: https://example.com", LogLevel = LogLevelConstants.INFO, Count = 2)] |
|
|
|
[LogMessage("Added CRL found at: https://example.com", LogLevel = LogLevelConstants.INFO, Count = 2)] |
|
|
|
[LogMessage("Added CRL url: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Checking CRL: https://itextpdf.com", LogLevel = LogLevelConstants.INFO, Count = 2)] |
|
|
|
[LogMessage("Added CRL found at: https://itextpdf.com", LogLevel = LogLevelConstants.INFO, Count = 2)] |
|
|
|
public virtual void ValidateSigNameWholeChainOcspCrlNoTest() { |
|
|
|
ValidateOptionLevelInclusion(CRL_DISTRIBUTION_POINT, LtvVerification.CertificateOption.WHOLE_CHAIN, LtvVerification.Level |
|
|
|
.OCSP_CRL, LtvVerification.CertificateInclusion.NO, true); |
|
|
|
} |
|
|
|
|
|
|
|
[NUnit.Framework.Test] |
|
|
|
[LogMessage("Added CRL url: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Checking CRL: https://example.com", LogLevel = LogLevelConstants.INFO, Count = 2)] |
|
|
|
[LogMessage("Added CRL found at: https://example.com", LogLevel = LogLevelConstants.INFO, Count = 2)] |
|
|
|
[LogMessage("Added CRL url: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Checking CRL: https://itextpdf.com", LogLevel = LogLevelConstants.INFO, Count = 2)] |
|
|
|
[LogMessage("Added CRL found at: https://itextpdf.com", LogLevel = LogLevelConstants.INFO, Count = 2)] |
|
|
|
public virtual void ValidateSigNameWholeChainOcspOptionalCrlNoTest() { |
|
|
|
ValidateOptionLevelInclusion(CRL_DISTRIBUTION_POINT, LtvVerification.CertificateOption.WHOLE_CHAIN, LtvVerification.Level |
|
|
|
.OCSP_OPTIONAL_CRL, LtvVerification.CertificateInclusion.NO, true); |
|
|
|
} |
|
|
|
|
|
|
|
[NUnit.Framework.Test] |
|
|
|
[LogMessage("Added CRL url: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Added CRL url: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
public virtual void ValidateSigNameWholeChainOcspNoTest() { |
|
|
|
ValidateOptionLevelInclusion(CRL_DISTRIBUTION_POINT, LtvVerification.CertificateOption.WHOLE_CHAIN, LtvVerification.Level |
|
|
|
.OCSP, LtvVerification.CertificateInclusion.NO, false); |
|
|
|
} |
|
|
|
|
|
|
|
[NUnit.Framework.Test] |
|
|
|
[LogMessage("Added CRL url: https://example.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Checking CRL: https://example.com", LogLevel = LogLevelConstants.INFO, Count = 2)] |
|
|
|
[LogMessage("Added CRL found at: https://example.com", LogLevel = LogLevelConstants.INFO, Count = 2)] |
|
|
|
[LogMessage("Added CRL url: https://itextpdf.com", LogLevel = LogLevelConstants.INFO)] |
|
|
|
[LogMessage("Checking CRL: https://itextpdf.com", LogLevel = LogLevelConstants.INFO, Count = 2)] |
|
|
|
[LogMessage("Added CRL found at: https://itextpdf.com", LogLevel = LogLevelConstants.INFO, Count = 2)] |
|
|
|
public virtual void ValidateSigNameWholeChainCrlNoTest() { |
|
|
|
ValidateOptionLevelInclusion(CRL_DISTRIBUTION_POINT, LtvVerification.CertificateOption.WHOLE_CHAIN, LtvVerification.Level |
|
|
|
.CRL, LtvVerification.CertificateInclusion.NO, true); |
|
|
|