Examples
/ Signing and verifying data entirely in memory (VB.NET example)
In This Topic
Signing and verifying data entirely in memory (VB.NET example)
In This Topic
VB.NET
Copy Code
Dim signer As New XceedEncryptionLib.XceedSigningClass()
signer.License( "your license key" )
Try Dim rsa As New XceedEncryptionLib.XceedRSASigningMethodClass()
' The following call to SetRandomKeyPair would, in the real world, ' be replaced by the assignment of a Private Key to the ' PrivateKey property. Dim seed As Object = Nothing rsa.SetRandomKeyPair( 512, seed )
' Set the signing method type signer.SigningMethod = rsa
Dim source As Object = "This is the data to sign" signer.Sign( source, true )
' Fetch the signature Dim signature As Object = rsa.Signature()
' Verify the signature signer.Verify( source, true )
Catch except As System.Runtime.InteropServices.COMException MessageBox.Show( except.ToString() ) End Try