D
David
Hi all,
I have to create a windows service in VB.NET. The service has to encrypt a
file using PGP. I have tried using NDSPGP component but out of 3 machines,
it only works on one (doesn't even work where I developed it, but I was
confident it should work so tried it on another developers machine and it
worked there.)
Anyhow, I have worked out the commands to encrypt using PGP from dos. This
appears to work fine when I use a command prompt.
So, I need to transfer that into vb.net.
Here, I have...
Proc = New Process
With Proc.StartInfo
.FileName = "cmd.exe"
.Arguments = "set PGPPASS=" & PGPSigningPhrase
.UseShellExecute = False
.RedirectStandardOutput = True
.CreateNoWindow = True
End With
Proc.Start()
Proc.WaitForExit()
With Proc.StartInfo
.FileName = "pgp.exe"
.Arguments = "-es " & sInputFile & " " & PGPRecipientKey &
" -u " & PGPSigningKey
.UseShellExecute = False
.RedirectStandardOutput = True
.CreateNoWindow = True
End With
Proc.Start()
but it is not working, nor is it erroring.
The first part sets the PGPPASS. This is required so that when running PGP,
it doesn't ask for the passphrase.
The second part is actually to run the PGP command.
Any ideas on how I can get this to work?
In my case, the pgp.exe file is in the path variable, so it doesn't need to
be explicitly referenced.
--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
I have to create a windows service in VB.NET. The service has to encrypt a
file using PGP. I have tried using NDSPGP component but out of 3 machines,
it only works on one (doesn't even work where I developed it, but I was
confident it should work so tried it on another developers machine and it
worked there.)
Anyhow, I have worked out the commands to encrypt using PGP from dos. This
appears to work fine when I use a command prompt.
So, I need to transfer that into vb.net.
Here, I have...
Proc = New Process
With Proc.StartInfo
.FileName = "cmd.exe"
.Arguments = "set PGPPASS=" & PGPSigningPhrase
.UseShellExecute = False
.RedirectStandardOutput = True
.CreateNoWindow = True
End With
Proc.Start()
Proc.WaitForExit()
With Proc.StartInfo
.FileName = "pgp.exe"
.Arguments = "-es " & sInputFile & " " & PGPRecipientKey &
" -u " & PGPSigningKey
.UseShellExecute = False
.RedirectStandardOutput = True
.CreateNoWindow = True
End With
Proc.Start()
but it is not working, nor is it erroring.
The first part sets the PGPPASS. This is required so that when running PGP,
it doesn't ask for the passphrase.
The second part is actually to run the PGP command.
Any ideas on how I can get this to work?
In my case, the pgp.exe file is in the path variable, so it doesn't need to
be explicitly referenced.
--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available