EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Verifying a plaintext signed file

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
#530
Posted: 06/23/2006 14:36:41
by Ned Schoenfeld (Basic support level)
Joined: 06/23/2006
Posts: 5

I am trying to use VerifyDetached to tell me if a plain text file is valid. Where is the result of this method returned? I don't get any result whether or not the signature file matches the source file.
Thanks,
Ned
#531
Posted: 06/23/2006 15:09:40
by Eugene Mayevski (EldoS Corp.)

1) please specify the version and edition of SecureBlackbox
2) It would be nice if you told us how you create the detached signature and how you verify it. Code snippets would help.


Sincerely yours
Eugene Mayevski
#532
Posted: 06/23/2006 15:12:06
by Ned Schoenfeld (Basic support level)
Joined: 06/23/2006
Posts: 5

version is 4.3.0.81
and here is the code snippet:

SBUtils.Unit.SetLicenseKey(SBUtils.Unit.BytesOfString(strLicenseKey))

Dim KeyRing1 As SBPGPKeys.TElPGPKeyring
Dim PGPReader As SBPGP.TElPGPReader
Dim oStream As IO.FileStream
Dim iStream As IO.FileStream
Dim vStream As IO.FileStream
Dim SR As IO.StreamReader
Dim SW As IO.StreamWriter

Dim strPubKeyRing As String = "C:\PGP\" & "NedPubRing.PKR"

KeyRing1 = New SBPGPKeys.TElPGPKeyring
KeyRing1.Load(strPubKeyRing, strPubKeyRing, True)

PGPReader = New SBPGP.TElPGPReader
PGPReader.VerifyingKeys = KeyRing1

'SR = New IO.StreamReader(oStream)

iStream = New IO.FileStream("c:\pgp\SignMe.TXT", IO.FileMode.Open)
vStream = New IO.FileStream("C:\pgp\SignMe.TXT.Sig", IO.FileMode.Open)

oStream = New IO.FileStream("c:\pgp\signmeResults.txt", IO.FileMode.Create)
PGPReader.OutputStream = oStream

PGPReader.VerifyDetached(iStream, vStream, 0, 0)
'PGPReader.DecryptAndVerify(iStream, 0)

iStream.Close()
vStream.Close()
oStream.Close()

MessageBox.Show("Done")
#533
Posted: 06/25/2006 07:00:04
by Eugene Mayevski (EldoS Corp.)

VerifyDetached fires OnSigned and OnSignatures events.

OnSigned lets you know the IDs of the keys, used for verification.
Verification results are passed via OnSignatures event .


Sincerely yours
Eugene Mayevski
#536
Posted: 06/26/2006 15:28:14
by Ned Schoenfeld (Basic support level)
Joined: 06/23/2006
Posts: 5

OK, I tried that and it works. Thanks. It seems that PGPMime and PGP are implemented slightly differently since there is no function that returns the verification results here, only the event. Suggestion: maybe make them more consistent in a future release? Thanks.
#538
Posted: 06/26/2006 15:45:21
by Eugene Mayevski (EldoS Corp.)

With PGPMIME you know what you have (i.e. signed or encrypted message). With PGP data the situation is much more complicated, -- a file can contain the number of signed and/or encrypted and/or compressed packets.


Sincerely yours
Eugene Mayevski
Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.

Reply

Statistics

Topic viewed 4843 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!