Discuss this help topic in SecureBlackbox Forum

Load CMS message

Customizing a CAdES signature You might have a requirement to customize signatures you create by including specific attributes to them, such as policy identifiers or extended signer information. There are two ways to include custom attributes to the signature when using TElCAdESSignatureProcessor class. As per the first one, you tune up the attributes before calling any TElCAdESSignatureProcessor.CreateXXX() method. Individual attributes can be accessed via the underlying TElCMSSignature object, for example: processor.Signature.SignaturePolicy.Included = true; processor.Signature.SignaturePolicy.Signed = true processor.Signature.SignaturePolicy.PolicyIdentifier = SBStrUtils.Unit.StrToOID("1.2.3.4.5"); The second method allows you to intercept and modify the signature object right before it is signed, and allows you to alter the default details added to the signature by the called CreateXXX() method. For example, you can use it to remove the csoUseGeneralizedTimeFormat from the signature options if your receiving application expects times to be encoded as UTCTime not GeneralizedTime. To intercept the signature template right before it is signed handle the TElCAdESSignatureProcessor.OnBeforeSign event. The event accepts three parameters: the signature object itself, the certificate it is going to be signed with, and the chain. You can alter the signature object as you wish before passing it over for signing.

Discuss this help topic in SecureBlackbox Forum