Buen dÃa ebb. Aquà te dejo un ejemplo sobre cómo crear una firma digital.
Agregar 2 controles CommandButton, 4 Label y 4 TextBox e REPLACEar el siguiente código
Private oCrypto As New CRYPTOAPILib.Crypto
Private Sub Command2_Click()
On Error GoTo ups
Text4.Text = oCrypto.DecryptString(Text2)
If oCrypto.VerifyDigitalSignature(Text3.Text) = _
False Then
MsgBox "AAAAHHH MALDITA COCHINADAAAA", vbCritical
End If
Exit Sub
ups:
MsgBox "No se encontró firma a normalizar", vbCritical
End Sub
Private Sub Command1_Click()
On Error GoTo ups
Text2.Text = oCrypto.EncryptString(Text1)
Text3.Text = oCrypto.DigitalSignature
Exit Sub
ups:
MsgBox "Introduzca texto a firmar", vbCritical
End Sub
Private Sub Form_Load()
oCrypto.ContainerName = "ranefilandia"
Llenar
End Sub
Public Sub Llenar()
Text1.Text = "ranefi"
Text2.Text = Empty
Text3.Text = Empty
Text4.Text = Empty
Label1.Caption = "Nombre a firmar"
Label2.Caption = "Nombre encriptado"
Label3.Caption = "Firma digital"
Label4.Caption = "Nombre original"
Command1.Caption = "Firmar"
Command2.Caption = "Normalizar"
Me.Caption = "Firma tu nick"
End Sub
Aquà te dejo el enlace de la librerÃa que debes descargar------------->
Para ver este enlace Registrate o Inicia SesionDescargar librerÃa
NOTA: Debes pegar la librerÃa en la carpeta C:\Windows\System32 y posteriormente crear una referencia a tu proyecto (Proyecto-->Referencias; seleccionar el botón Browse y buscar la librerÃa). Espero y todo haya quedado claro. Nos vemos.