Table of Contents

Class SignatureValidationProperties

Namespace
iText.Signatures.Validation.V1
Assembly
itext.sign.dll

Class which stores properties, which are related to signature validation process.

public class SignatureValidationProperties
Inheritance
SignatureValidationProperties
Inherited Members

Constructors

SignatureValidationProperties()

Create SignatureValidationProperties with default values.

public SignatureValidationProperties()

Fields

DEFAULT_CONTINUE_AFTER_FAILURE

public const bool DEFAULT_CONTINUE_AFTER_FAILURE = true

Field Value

bool

DEFAULT_FRESHNESS_HISTORICAL

public static readonly TimeSpan DEFAULT_FRESHNESS_HISTORICAL

Field Value

TimeSpan

DEFAULT_FRESHNESS_PRESENT_CRL

public static readonly TimeSpan DEFAULT_FRESHNESS_PRESENT_CRL

Field Value

TimeSpan

DEFAULT_FRESHNESS_PRESENT_OCSP

public static readonly TimeSpan DEFAULT_FRESHNESS_PRESENT_OCSP

Field Value

TimeSpan

DEFAULT_ONLINE_FETCHING

public static readonly SignatureValidationProperties.OnlineFetching DEFAULT_ONLINE_FETCHING

Field Value

SignatureValidationProperties.OnlineFetching

Methods

AddCrlClient(ICrlClient)

Adds new ICrlClient instance which will be used to retrieve CRL responses during the validation.

public SignatureValidationProperties AddCrlClient(ICrlClient crlClient)

Parameters

crlClient ICrlClient

ICrlClient instance which will be used to retrieve CRL responses during the validation

Returns

SignatureValidationProperties

this same SignatureValidationProperties instance

AddOcspClient(IOcspClient)

Adds new IOcspClient instance which will be used to retrieve OCSP response during the validation.

public SignatureValidationProperties AddOcspClient(IOcspClient ocspClient)

Parameters

ocspClient IOcspClient

IOcspClient instance which will be used to retrieve OCSP response during the validation

Returns

SignatureValidationProperties

this same SignatureValidationProperties instance

GetContinueAfterFailure(ValidationContext)

Returns the Continue after failure setting for the provided context or the default context.

public virtual bool GetContinueAfterFailure(ValidationContext validationContext)

Parameters

validationContext ValidationContext

the context for which to retrieve the Continue after failure setting

Returns

bool

the Continue after failure setting for the provided context or the default context

GetCrlClients()

Gets all ICrlClient instances which will be used to retrieve CRL responses during the validation.

public virtual IList<ICrlClient> GetCrlClients()

Returns

IList<ICrlClient>

all ICrlClient instances which will be used to retrieve CRL responses during the validation

GetFreshness(ValidationContext)

Returns the freshness setting for the provided validation context or the default context in milliseconds.

public virtual TimeSpan GetFreshness(ValidationContext validationContext)

Parameters

validationContext ValidationContext

the validation context for which to retrieve the freshness setting

Returns

TimeSpan

the freshness setting for the provided validation context or the default context in milliseconds

GetOcspClients()

Gets all IOcspClient instances which will be used to retrieve OCSP responses during the validation.

public virtual IList<IOcspClient> GetOcspClients()

Returns

IList<IOcspClient>

all IOcspClient instances which will be used to retrieve OCSP responses during the validation

GetRequiredExtensions(ValidationContext)

Returns required extension for the provided validation context.

public virtual IList<CertificateExtension> GetRequiredExtensions(ValidationContext validationContext)

Parameters

validationContext ValidationContext

the validation context for which to retrieve required extensions

Returns

IList<CertificateExtension>

required extensions for the provided validation context

GetRevocationOnlineFetching(ValidationContext)

Sets the onlineFetching property representing possible online fetching permissions.

public virtual SignatureValidationProperties.OnlineFetching GetRevocationOnlineFetching(ValidationContext validationContext)

Parameters

validationContext ValidationContext

the context for which to retrieve the online fetching setting

Returns

SignatureValidationProperties.OnlineFetching

the online fetching setting.

SetContinueAfterFailure(ValidatorContexts, CertificateSources, bool)

Sets the Continue after failure setting for the provided context. This parameter specifies if validation is expected to continue after first failure is encountered. Only is considered to be a failure.

public SignatureValidationProperties SetContinueAfterFailure(ValidatorContexts validatorContexts, CertificateSources certificateSources, bool value)

Parameters

validatorContexts ValidatorContexts

the validators for which to set the Continue after failure setting

certificateSources CertificateSources

the certificateSources for which to set the Continue after failure setting

value bool

the Continue after failure setting

Returns

SignatureValidationProperties

this same SignatureValidationProperties instance.

SetFreshness(ValidatorContexts, CertificateSources, TimeBasedContexts, TimeSpan)

Sets the freshness setting for the specified validator, time based and certificate source contexts in milliseconds. This parameter specifies how old revocation data can be, compared to validation time, in order to be trustworthy.

public SignatureValidationProperties SetFreshness(ValidatorContexts validatorContexts, CertificateSources certificateSources, TimeBasedContexts timeBasedContexts, TimeSpan value)

Parameters

validatorContexts ValidatorContexts

the validators for which to apply the setting

certificateSources CertificateSources

the certificate sources to

timeBasedContexts TimeBasedContexts

the date comparison context for which to apply the setting

value TimeSpan

the settings value in milliseconds

Returns

SignatureValidationProperties

this same SignatureValidationProperties instance.

SetRequiredExtensions(CertificateSources, IList<CertificateExtension>)

Set list of extensions which are required to be set to a certificate depending on certificate source.

By default, required extensions are set to be compliant with common validation norms. Changing those can result in falsely positive validation result.
public SignatureValidationProperties SetRequiredExtensions(CertificateSources certificateSources, IList<CertificateExtension> requiredExtensions)

Parameters

certificateSources CertificateSources

CertificateSource for extensions to be present

requiredExtensions IList<CertificateExtension>

list of required CertificateExtension

Returns

SignatureValidationProperties

this same SignatureValidationProperties instance

SetRevocationOnlineFetching(ValidatorContexts, CertificateSources, TimeBasedContexts, OnlineFetching)

Sets the onlineFetching property representing possible online fetching permissions.

public SignatureValidationProperties SetRevocationOnlineFetching(ValidatorContexts validatorContexts, CertificateSources certificateSources, TimeBasedContexts timeBasedContexts, SignatureValidationProperties.OnlineFetching onlineFetching)

Parameters

validatorContexts ValidatorContexts

the validators for which to set this value

certificateSources CertificateSources

the certificate source for which to set this value

timeBasedContexts TimeBasedContexts

time perspective context, at which validation is happening

onlineFetching SignatureValidationProperties.OnlineFetching

onlineFetching property value to set

Returns

SignatureValidationProperties

this same SignatureValidationProperties instance.