Clear Sign File
  • 20 Mar 2024
  • 3 Minutes to read
  • Dark
    Light

Clear Sign File

  • Dark
    Light

Article Summary

Step Details

Introduced in Version4.0.0
Last Modified in Version8.1.0
LocationPGP Steps


The Clear Sign File step allows users to sign a file digitally but keep the file contents in plain PGP text. 



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 the Hash Algorithm type from a dropdown list (MD5, Sha1, RipeMD160, DoubleSha, MD2, Tiger192, Havel5pass160, Sha256, Sha384, Sha512, Sha224). To see the dropdown list, select Constant mapping.
HasAlgorithmTag
DataThe desired file to sign
List of Byte
Output File NameAllows the user to specify the file name and extension (i.e., SignednewFile.pdf)
String
Private KeyGenerated PGP private key file
List of Byte
Private Key PasswordPassword for the specified Private Key
String

Outputs

PropertyDescriptionData Type
OutputOutputs the signed file with the contents of the file in PGP encrypted plain textFileData

Example Inputs and Outputs

AlgorithmDataOutput File NamePrivate KeyPrivate Key PasswordOutput
Sha1lesson.txtsignedLesson.txtpriv-sec.ascchart

Id: "4141afa7-f81f-4069-89ba-85417fdec462",FileName: "clearedFile.txt",Length: 412,FileType: ".txt"

MD5Nullpackage.txtpriv-sec.asc
chartEXCEPTION MESSAGE
Sha256processing.xlsEmptypriv-sec.ascchartEXCEPTION MESSAGE
Sha384example.txtexampleSign.txtpriv-sec.asc
NullEXCEPTION MESSAGE
NullshowPage.htmlsignShow.htmlpriv-sec.ascchartEXCEPTION MESSAGE
MD2single.txtexampleSingle.txtpreExpample.txtchartEXCEPTION MESSAGE


Common Errors

Object reference not set to an instance of an object.

If the Private Key Password or Output File Name 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 Clear Sign File 1[ClearSignFile] in flow [Flow 2]: Exception invoking method ClearSignFile on class PGPSteps
 ---> DecisionsFramework.LoggedException: Exception invoking method ClearSignFile on class PGPSteps
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
 at Decsisions.PGP.Steps.Processor.GetPrivateKey(PgpSecretKey secretKey, String password
 at Decsisions.PGP.Steps.ClearSignedFileProcessor.ClearSignStream(Stream dataStream, Stream keyIn, String privateKeyPassword, HashAlgorithmTag digest, Stream outputStream
 at Decsisions.PGP.Steps.PGPSteps.ClearSignFile(Byte[] privateKey, String privateKeyPassword, Byte[] data, 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 ---

The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters

If the file uploaded or mapped to the Private Key is an invalid PGP Private Key file or any other file type (ie. .pdf, .docx, etc.), the step will cause an error.

To correct this, ensure that the only file being mapped or uploaded for the Private Key field is a correctly formatted PGP Private Key file.

Exception Message:

Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Clear Sign File 1[ClearSignFile] in flow [Flow 2]: Exception invoking method ClearSignFile on class PGPSteps
 ---> DecisionsFramework.LoggedException: Exception invoking method ClearSignFile on class PGPSteps
 ---> System.IO.IOException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. at Org.BouncyCastle.Bcpg.OpenPgp.PgpUtilities.GetDecoderStream(Stream inputStream
 at Decsisions.PGP.Steps.Processor.GetSecretKeyRingBundle(Stream inputStream
 at Decsisions.PGP.Steps.Processor.GetPgpSecretKey(Stream stream
 at Decsisions.PGP.Steps.ClearSignedFileProcessor.ClearSignStream(Stream dataStream, Stream keyIn, String privateKeyPassword, HashAlgorithmTag digest, Stream outputStream
 at Decsisions.PGP.Steps.PGPSteps.ClearSignFile(Byte[] privateKey, String privateKeyPassword, Byte[] data, 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 ---

Buffer cannot be null.

If the Data field is null or empty, the step will cause an error.

To correct this, ensure that a file is mapped or uploaded to the Data field.

Exception Message:

Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Clear Sign File 1[ClearSignFile] in flow [Flow 2]: Exception invoking method ClearSignFile on class PGPSteps
 ---> DecisionsFramework.LoggedException: Exception invoking method ClearSignFile on class PGPSteps
 ---> System.ArgumentNullException: Buffer cannot be null. (Parameter 'buffer'
 at System.IO.MemoryStream..ctor(Byte[] buffer
 at Decsisions.PGP.Steps.PGPSteps.ClearSignFile(Byte[] privateKey, String privateKeyPassword, Byte[] data, 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 ---

[BusinessRule] Parameter 'algorithm' of 'ClearSignFile' can not be null 

If the Algorithm field is null or empty, the step will cause an error.

To correct this, set the mapping for the Algorithm field to Constant and select the desired option.

Exception Message:

Exception Stack Trace: DecisionsFramework.BusinessRuleException: [BusinessRule] Parameter 'algorithm' of 'ClearSignFile' 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)

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?