EasyByte Software

Welcome to EasyByte Software

Home Buy Online Products Downloads Support
Sections
Index
About
Installation
Properties
Methods
ASP and dotNET
Further Information
  

 

 

PGPDecryptVerifyFile Method
 
     

Cryptocx v7 User Guide

 

PGPDecryptVerifyFile Method

This is the method that you use to decrypt a PGP encrypted and signed file. This method is complementary to the PGPEncryptSignFile method.

 

Description

Decrypts a PGP encrypted file.

     
Syntax

x = object.PGPDecryptVerifyFile

The syntax of the PGPDecryptVerifyFile method has these parts:

 
Part Description
object A Cryptocx v7 control.
x A string that becomes either "TRUE" or "Error: xxx" where xxx is the error message.

       
Remarks

This method requires the use of a secret key ring, you have to specify the directory in which the secret key ring resides though the KeyFolder property. Cryptocx will automatically search through the secret ring in the specified directory to find the required key.

You need to specify the Password of the secret key that is needed.

You need to specify the file to decrypt, the SourceFile.

You need to specify where the result of decryption will go, the DestinationFile.

This method after decrypting the file will then verify the signature, if the signature cannot be verified, then it will not return "TRUE" even if the file can be decrypted fine.

       
Returns

String

     
Example Sample Visual Basic Code to decrypt a PGP encrypted and signed file:

Where Cryptocx1 is an instance of a Cryptocx Control.

Dim theResult As String

Cryptocx1.KeyFolder = "C:\mykeys\"
Cryptocx1.Password = "mypass"
Cryptocx1.SourceFile = "C:\fileToDecrypt.txt"
Cryptocx1.DestinationFile = "C:\decrypted.txt"
theResult = Cryptocx1.PGPDecryptVerifyFile

'' Check to see what has happened
''

If theResult = "TRUE" Then
  '' Ok, the Decryption went well with no errors
Else
 MsgBox theResult
End If

 

 

 

 

Back to Contents Page

 

Click here to set this great site as your home page

Or click here to add it to your Favorites.

  
  
 

Copyright (c) EasyByte Software 1998-2008, info@easybyte.com