Extraer el No ce certificado en VB sin openssl:
Crear un formulario con un boton y dos etiquetas.
el certificado está en c:\1\aaa010101aaa.cer.pem
El codigo:
Código:
Imports System
Imports System.Security.Cryptography.X509Certificates
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim CertHex As String
Dim cert As X509Certificate = X509Certificate.CreateFromCertFile("c:\1\aaa010101aaa.cer.pem")
CertHex = cert.GetSerialNumberString()
Label1.Text = "Hex: " & CertHex
Dim Data1 As String = ""
Dim Resultado As String = ""
While CertHex.Length > 0
Data1 = System.Convert.ToChar(System.Convert.ToUInt32(CertHex.Substring(0, 2), 16)).ToString()
Resultado = Resultado & Data1
CertHex = CertHex.Substring(2, CertHex.Length - 2)
End While
Label2.Text = Resultado
End Sub
End Class
al darle click en el boton sale en la label1: el No en hex, y el la label 2 el No buscado
Saludos
Oscar