X509Certificate.GetEffectiveDateString Método
Definição
Retorna a data de efetivação deste certificado X.509v3.Returns the effective date of this X.509v3 certificate.
public:
virtual System::String ^ GetEffectiveDateString();
public virtual string GetEffectiveDateString ();
abstract member GetEffectiveDateString : unit -> string
override this.GetEffectiveDateString : unit -> string
Public Overridable Function GetEffectiveDateString () As String
Retornos
A data de efetivação do certificado X.509.The effective date for this X.509 certificate.
Exemplos
O exemplo a seguir usa o GetEffectiveDateString método para obter a data de efetivação de um certificado e o exibe para o console.The following example uses the GetEffectiveDateString method to get the effective date of a certificate and displays it to the console.
using namespace System;
using namespace System::Security::Cryptography::X509Certificates;
int main()
{
// The path to the certificate.
String^ Certificate = "Certificate.cer";
// Load the certificate into an X509Certificate object.
X509Certificate^ cert = X509Certificate::CreateFromCertFile( Certificate );
// Get the value.
String^ results = cert->GetEffectiveDateString();
// Display the value to the console.
Console::WriteLine( results );
}
using System;
using System.Security.Cryptography.X509Certificates;
public class X509
{
public static void Main()
{
// The path to the certificate.
string Certificate = "Certificate.cer";
// Load the certificate into an X509Certificate object.
X509Certificate cert = X509Certificate.CreateFromCertFile(Certificate);
// Get the value.
string results = cert.GetEffectiveDateString();
// Display the value to the console.
Console.WriteLine(results);
}
}
Imports System.Security.Cryptography.X509Certificates
Public Class X509
Public Shared Sub Main()
' The path to the certificate.
Dim Certificate As String = "Certificate.cer"
' Load the certificate into an X509Certificate object.
Dim cert As X509Certificate = X509Certificate.CreateFromCertFile(Certificate)
' Get the value.
Dim results As String = cert.GetEffectiveDateString()
' Display the value to the console.
Console.WriteLine(results)
End Sub
End Class
Comentários
A data de efetivação é a data após a qual o certificado X. 509 é considerado válido.The effective date is the date after which the X.509 certificate is considered valid.
O GetEffectiveDateString método retorna uma cadeia de caracteres que mostra a data formatada no padrão de data abreviada seguido pelo horário formatado no padrão de hora completa.The GetEffectiveDateString method returns a string that shows the date formatted in Short Date Pattern followed by the time formatted in Long Time Pattern. A data e hora são formatadas usando a cultura atual e o fuso horário.The date and time are formatted using the current culture and time zone.