X509ChainPolicy.VerificationTime Propriedade

Definição

Obtém ou define a hora para qual a cadeia deve ser validada.Gets or sets the time for which the chain is to be validated.

public:
 property DateTime VerificationTime { DateTime get(); void set(DateTime value); };
public DateTime VerificationTime { get; set; }
member this.VerificationTime : DateTime with get, set
Public Property VerificationTime As DateTime

Valor da propriedade

DateTime

Um objeto DateTime.A DateTime object.

Exemplos

O exemplo a seguir abre o repositório de certificados pessoais do usuário atual, permite que o usuário selecione um certificado e, em seguida, grava as informações do certificado e da cadeia de certificados no console.The following example opens the current user's personal certificate store, allows the user to select a certificate, then writes certificate and certificate chain information to the console. A saída depende do certificado selecionado.The output depends on the certificate you select.

//Output chain information of the selected certificate.
X509Chain ^ ch = gcnew X509Chain;
ch->ChainPolicy->RevocationMode = X509RevocationMode::Online;
ch->Build( certificate );
Console::WriteLine( "Chain Information" );
Console::WriteLine( "Chain revocation flag: {0}", ch->ChainPolicy->RevocationFlag );
Console::WriteLine( "Chain revocation mode: {0}", ch->ChainPolicy->RevocationMode );
Console::WriteLine( "Chain verification flag: {0}", ch->ChainPolicy->VerificationFlags );
Console::WriteLine( "Chain verification time: {0}", ch->ChainPolicy->VerificationTime );
Console::WriteLine( "Chain status length: {0}", ch->ChainStatus->Length );
Console::WriteLine( "Chain application policy count: {0}", ch->ChainPolicy->ApplicationPolicy->Count );
Console::WriteLine( "Chain certificate policy count: {0} {1}", ch->ChainPolicy->CertificatePolicy->Count, Environment::NewLine );
//Output chain information of the selected certificate.
X509Chain ch = new X509Chain();
ch.ChainPolicy.RevocationMode = X509RevocationMode.Online;
ch.Build (certificate);
Console.WriteLine ("Chain Information");
Console.WriteLine ("Chain revocation flag: {0}", ch.ChainPolicy.RevocationFlag);
Console.WriteLine ("Chain revocation mode: {0}", ch.ChainPolicy.RevocationMode);
Console.WriteLine ("Chain verification flag: {0}", ch.ChainPolicy.VerificationFlags);
Console.WriteLine ("Chain verification time: {0}", ch.ChainPolicy.VerificationTime);
Console.WriteLine ("Chain status length: {0}", ch.ChainStatus.Length);
Console.WriteLine ("Chain application policy count: {0}", ch.ChainPolicy.ApplicationPolicy.Count);
Console.WriteLine ("Chain certificate policy count: {0} {1}", ch.ChainPolicy.CertificatePolicy.Count, Environment.NewLine);
'Output chain information of the selected certificate.
Dim ch As New X509Chain()
ch.ChainPolicy.RevocationMode = X509RevocationMode.Online
ch.Build(certificate)
Console.WriteLine("Chain Information")
Console.WriteLine("Chain revocation flag: {0}", ch.ChainPolicy.RevocationFlag)
Console.WriteLine("Chain revocation mode: {0}", ch.ChainPolicy.RevocationMode)
Console.WriteLine("Chain verification flag: {0}", ch.ChainPolicy.VerificationFlags)
Console.WriteLine("Chain verification time: {0}", ch.ChainPolicy.VerificationTime)
Console.WriteLine("Chain status length: {0}", ch.ChainStatus.Length)
Console.WriteLine("Chain application policy count: {0}", ch.ChainPolicy.ApplicationPolicy.Count)
Console.WriteLine("Chain certificate policy count: {0} {1}", ch.ChainPolicy.CertificatePolicy.Count, Environment.NewLine)

Comentários

Essa propriedade representa o parâmetro de tempo para validação de cadeia.This property represents the time parameter for chain validation. Essa propriedade retorna um valor que indica a hora em que a cadeia deve ser validada, seja como hora local ou UTC, dependendo do valor da DateTime.Kind propriedade.This property returns a value indicating the time the chain is to be validated, either as local time or UTC, depending on the value of the DateTime.Kind property. Essa propriedade é importante ao validar mensagens assinadas, já que a assinatura deve ter sido válida no momento da assinatura, não no momento da validação.This property is important when validating signed messages, since the signature must have been valid at the time of signing, not at the time of validation. Cada certificado na cadeia deve ter uma X509Certificate2.NotBefore hora não posterior ao valor da propriedade e uma X509Certificate2.NotAfter hora não anterior ao valor dessa propriedade.Every certificate in the chain must have a X509Certificate2.NotBefore time no later than this property's value and a X509Certificate2.NotAfter time no earlier than this property's value. Caso contrário, o X509ChainStatusFlags.NotTimeValid sinalizador será declarado.Otherwise, the X509ChainStatusFlags.NotTimeValid flag is asserted. No Windows, essa propriedade também pode ser usada para determinar o status de revogação de um certificado.On Windows, this property may also be used to determine the revocation status of a certificate.

O construtor sem parâmetros para a X509ChainPolicy classe define a VerificationTime propriedade como a hora em que o construtor é chamado.The parameterless constructor for the X509ChainPolicy class sets the VerificationTime property to the time the constructor is called. Chamar o Reset() método substitui o valor de VerificationTime pela hora atual do sistema, não pela hora em que o objeto foi construído.Calling the Reset() method replaces the value of VerificationTime with the current system time, not with the time that the object was constructed.

Aplica-se a