--- title: "Decrypt and Verify File" slug: "decrypt-and-verify-file" tags: ["PGP module", "file", "decrypt", "signed", "verify"] updated: 2024-12-11T14:52:04Z published: 2024-12-11T14:52:04Z canonical: "documentation.decisions.com/decrypt-and-verify-file" --- > ## Documentation Index > Fetch the complete documentation index at: https://documentation.decisions.com/llms.txt > Use this file to discover all available pages before exploring further. # Decrypt and Verify File | ## Step Details | | --- | | **Introduced in Version** | 4.0.0 | | **Last Modified in Version** | 8.1.0 | | **Location** | PGP Steps | --- The **Decrypt and Verify File** step allows a user to decrypt a PGP file that has been digitally signed. ### Prerequisites This step requires the [PGP module](https://documentation.decisions.com/docs/pgp) to be [installed](https://documentation.decisions.com/docs/installing-modules-decisions) before it will be available in the toolbox. --- ## Properties #### Inputs | Property | Description | Data Type | | --- | --- | --- | | File | The desired signed file to decrypt. Using an encrypted PGP file will not throw an error but will not decrypt the file. | FileData | | Private Key | Generated PGP Private Key file | List of Byte | | Private Key Password | Password for the specified Private Key file | String | | Public Key | Generated Public Key file | List of Byte | #### Outputs | Property | Description | Data Type | | --- | --- | --- | | Output | Outputs the decrypted file | FileData | --- ## Example Inputs and Outputs | File | Private Key | Private Key Password | Public Key | Output | | --- | --- | --- | --- | --- | | NewsignedFile.txt | p-sec.asc | flex | open-pub.asc | Id: "99cd43fb-129f-4723-840b-feea020760f8",FileName: "NewsignedFile.txt",Length: 7,FileType: ".txt" | | encrypted_sample.pdf | p-sec.asc | flex | open-pub.asc | data: {} | | Null | p-sec.asc | flex | open-pub.asc | EXCEPTION MESSAGE | | example.txt | Empty | flex | open-pub.asc | EXCEPTION MESSAGE | | example.txt | p-sec.asc | Null | open-pub.asc | Id: "8957e8ad-f8c3-478e-9c08-446592f67890",FileName: "example.txt",Length: 327,FileType: ".txt" | | sample.pdf | p-sec.asc | flex | Null | EXCEPTION MESSAGE | #### ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1675354709084.png) --- ## Common Errors ### Object reference not set to an instance of an object If the Data field is null or empty, the step will cause an error. To correct this, ensure that a signed PGP file is uploaded or mapped to the field. #### Exception Message: ```csharp Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Decrypt And Verify File 1[DecryptAndVerifyFile] in flow [Flow 2]: Exception invoking method DecryptAndVerifyFile on class PGPSteps ---> DecisionsFramework.LoggedException: Exception invoking method DecryptAndVerifyFile on class PGPSteps ---> System.NullReferenceException: Object reference not set to an instance of an object. at Decsisions.PGP.Steps.PGPSteps.DecryptAndVerifyFile(Byte[] privateKey, String privateKeyPassword, Byte[] publicKey, FileData file) --- End of inner exception stack trace --- at DecisionsFramework.Design.Flow.StepImplementations.InvokeMethodStep.Run(StepStartData data at DecisionsFramework.Design.Flow.FlowStep.RunStepInternal(String flowTrackingID, String stepTrackingID, KeyValuePairDataStructure[] stepRunDataValues, AbstractFlowTrackingData trackingData at DecisionsFramework.Design.Flow.FlowStep.Start(String flowTrackingID, String stepTrackingID, FlowStateData data, AbstractFlowTrackingData trackingData, RunningStepData currentStepData) --- End of inner exception stack trace --- ``` --- ### Buffer cannot be null. If the Public Key or Private Key fields are null or empty, the step will cause an error. To correct this, ensure that the appropriate file is uploaded or mapped to the Public Key and Private Key fields. #### Exception Message: ```csharp Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Decrypt And Verify File 1[DecryptAndVerifyFile] in flow [Flow 2]: Exception invoking method DecryptAndVerifyFile on class PGPSteps ---> DecisionsFramework.LoggedException: Exception invoking method DecryptAndVerifyFile on class PGPSteps ---> System.ArgumentNullException: Buffer cannot be null. (Parameter 'buffer' at System.IO.MemoryStream..ctor(Byte[] buffer at Decsisions.PGP.Steps.PGPSteps.DecryptAndVerifyFile(Byte[] privateKey, String privateKeyPassword, Byte[] publicKey, FileData file) --- End of inner exception stack trace --- at DecisionsFramework.Design.Flow.StepImplementations.InvokeMethodStep.Run(StepStartData data at DecisionsFramework.Design.Flow.FlowStep.RunStepInternal(String flowTrackingID, String stepTrackingID, KeyValuePairDataStructure[] stepRunDataValues, AbstractFlowTrackingData trackingData at DecisionsFramework.Design.Flow.FlowStep.Start(String flowTrackingID, String stepTrackingID, FlowStateData data, AbstractFlowTrackingData trackingData, RunningStepData currentStepData) --- End of inner exception stack trace --- ``` --- Related Information Documentation: [PGP Module](https://documentation.decisions.com/docs/pgp-module-overview) Forum Posts: [Email Encrypt / Decrypt With PGP Module](https://support.decisions.com/forum/topic1520-email-encrypt--decrypt-with-pgp-module.aspx) [Error While Encrypting A File Using PGP](https://support.decisions.com/forum/topic1814-error-while-encrypting-a-file-using-pgp.aspx) [PGP Issues With Decrypting Using Private Key](https://support.decisions.com/forum/topic2522-pgp-issues-with-decrypting-using-private-key.aspx) ## Related - [Encrypt File](/encrypt-file.md) - [Sign File](/sign-file.md) - [Decrypt File](/decrypt-file.md) - [Verify File](/verify-file.md)