- 11 Nov 2024
- 2 Minutes to read
- Print
- DarkLight
Sign File
- Updated on 11 Nov 2024
- 2 Minutes to read
- Print
- DarkLight
Step Details | |
Introduced in Version | 4.0.0 |
Last Modified in Version | 8.1.0 |
Location | PGP Steps |
The Sign File step uses a PGP Private Key and Private Key Password to sign a file. The Decrypt File or Decrypt and Verify File step is needed to decrypt the file to be read.
Upgrading to v8.13+
Customers using the Sign File, Clear Sign File, or Sign And Encrypt File steps need to drag and drop these steps after upgrade into the Flows using them.
Steps that are already in Flows may have their mapping set to Null on upgrade.
Prerequisites
This step requires the PGP module to be installed before it will be available in the toolbox.
Properties
Inputs
Property | Description | Data Type |
---|---|---|
Algorithm | Allows the user to select a Hash Algorithm type (MD5, Sha1, RipeMD160, DoubleSha, MD2, Tiger192, Havel5pass160, Sha256, Sha384, Sha512, Sha224). To see the dropdown list, select Constant mapping. | HashAlgorithmTag |
Binary | Defines whether the output file is encrypted as bytes or raw text/ascii | Boolean |
Data | The desired file to sign | List of Byte |
Internal File Label | Specifies the name of the internal file of the signed and encrypted file | String |
Output File Name | Allows the user to specify the file name and file extension for the signed file (i.e., SignednewFile.pdf) | String |
Private Key | Generated PGP Private Key file | List of Byte |
Private Key Password | Password for the specified Private Key file | String |
Outputs
Property | Description | Data Type |
---|---|---|
Output | Outputs a digitally signed file | FileData |
Example Inputs and Outputs
Algorithm | Binary | Data | Internal File Label | Output File Name | Private Key | Private Key Password | Output |
---|---|---|---|---|---|---|---|
MD5 | True | upcomingShow.pdf | Null | signedShow.pdf | priv-sec.asc | catch | Id: "8680b789-368b-4ad0-a618-2e3ce82be969",FileName: "signedShow.pdf",Length: 1409,FileType: ".pdf" |
Sha1 | False | Null | Local | signedNew.docx | new-sec.asc | catch | EXCEPTION MESSAGE |
Null | False | example.txt | Internal Label | docsigned.txt | priv-sec.asc | catch | EXCEPTION MESSAGE |
MD2 | Empty | sample.pdf | Sample | sampleSign.pdf | new-priv-sec.asc | catch | EXCEPTION MESSAGE |
Sha256 | False | newText.txt | Null | signedFile.txt | priv-sec.asc | catch | Id: "c7abef89-7ae6-45a0-a4e5-2ed2df3657da",FileName: "signatureFile.txt",Length: 399,FileType: ".txt" |
Tiger192 | False | sample.ppx | Sample | Empty | new-priv-sec.asc | catch | EXCEPTION MESSAGE |
Sha256 | False | example.docx | Example | upSigned.docx | Null | catch | EXCEPTION MESSAGE |
Sha512 | True | example.txt | Internal | signedFile | priv-sec.asc | catch | Id: "a6b874dd-2073-4b7d-a63c-395f4b17b716",FileName: "signedFile",Length: 395,FileType: "" |
Common Errors
Buffer cannot be null
If the Data field is empty or null, the step will cause an error.
To correct this, ensure that a file is mapped or uploaded as a value for the Data field.
Exception Message:
Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Sign File 1[SignFile] in flow [Flow 2]: Exception invoking method SignFile on class PGPSteps
---> DecisionsFramework.LoggedException: Exception invoking method SignFile on class PGPSteps
---> System.ArgumentNullException: Buffer cannot be null. (Parameter 'buffer'
at System.IO.MemoryStream..ctor(Byte[] buffer
at Decsisions.PGP.Steps.PGPSteps.SignFile(String internalFileLabel, Byte[] privateKey, String privateKeyPassword, Byte[] data, Boolean binary, HashAlgorithmTag algorithm, String outputFileName)
--- 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 ---
Parameter 'binary' of 'SignFile' can not be null
If the Binary field is null or empty, the step will cause an error.
To correct this, set the input mapping for the Binary field to Constant.
Exception Message:
Exception Stack Trace: DecisionsFramework.BusinessRuleException: [BusinessRule] Parameter 'binary' of 'SignFile' can not be null
at DecisionsFramework.Design.Flow.CoreSteps.InvokeMethodUtility.ThrowErrorIfNullIsNotAllowed(MethodInfo methodInfo, Object[] parameterValues, String errorMessage
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)
Object reference not set to an instance of an object
If the Output File Name or Private Key Password is null or empty, the step will cause an error.
To correct this, ensure that a value is entered or mapped to the field.
Exception Message:
Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Sign File 1[SignFile] in flow [Flow 2]: Object reference not set to an instance of an object.
---> System.NullReferenceException: Object reference not set to an instance of an object.
at DecisionsFramework.Data.DataTypes.FileData.ProcessValueAddedToFlowData(String filePath, Boolean isFilePathFromSearch
at DecisionsFramework.Data.DataTypes.FileData.ValueAdded(
at DecisionsFramework.Design.Flow.Mapping.KeyValueDictionary.Add(KeyValuePairDataStructure item
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 ---
Documentation:
PGP Module
Forum Posts:
Email Encrypt / Decrypt With PGP Module
Error While Encrypting A File Using PGP
PGP Issues With Decrypting Using Private Key