Sign File
  • 11 Nov 2024
  • 2 Minutes to read
  • Dark
    Light

Sign File

  • Dark
    Light

Article summary

Step Details

Introduced in Version4.0.0
Last Modified in Version8.1.0
LocationPGP 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

PropertyDescriptionData Type
AlgorithmAllows 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
BinaryDefines whether the output file is encrypted as bytes or raw text/ascii
Boolean
DataThe desired file to sign
List of Byte
Internal File LabelSpecifies the name of the internal file of the signed and encrypted file
String
Output File NameAllows the user to specify the file name and file extension for the signed file (i.e., SignednewFile.pdf)
String
Private KeyGenerated PGP Private Key file
List of Byte
Private Key PasswordPassword for the specified Private Key file
String

Outputs

PropertyDescriptionData Type
OutputOutputs a digitally signed file FileData

Example Inputs and Outputs

AlgorithmBinaryDataInternal File LabelOutput File NamePrivate KeyPrivate Key PasswordOutput
MD5TrueupcomingShow.pdfNullsignedShow.pdfpriv-sec.asccatch

Id: "8680b789-368b-4ad0-a618-2e3ce82be969",FileName: "signedShow.pdf",Length: 1409,FileType: ".pdf"

Sha1FalseNullLocalsignedNew.docxnew-sec.asccatchEXCEPTION MESSAGE
NullFalseexample.txtInternal Labeldocsigned.txtpriv-sec.asc
catchEXCEPTION MESSAGE
MD2Emptysample.pdfSamplesampleSign.pdfnew-priv-sec.asc
catchEXCEPTION MESSAGE
Sha256FalsenewText.txtNullsignedFile.txtpriv-sec.asccatch

Id: "c7abef89-7ae6-45a0-a4e5-2ed2df3657da",FileName: "signatureFile.txt",Length: 399,FileType: ".txt"

Tiger192Falsesample.ppxSampleEmptynew-priv-sec.asc
catchEXCEPTION MESSAGE
Sha256Falseexample.docxExampleupSigned.docxNullcatchEXCEPTION MESSAGE
Sha512Trueexample.txtInternalsignedFilepriv-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 ---

Related Information

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


Was this article helpful?