Discuss this help topic in SecureBlackbox Forum
Upgrade CAdES signature to another level
TElCAdESSignatureProcessor offers functionality for upgrading CAdES signatures to a different (normally higher) levels.
To upgrade an existing signature:
-
Load the CMS blob into a TElSignedCMSMessage object and get the desired TElCMSSignature:
TElCMSSignature sig = cms.get_Signatures(0);
-
Create a TElCAdESSignatureProcessor object passing the signature to its constructor:
TElCAdESSignatureProcessor processor = new TElCAdESSignatureProcessor(sig);
-
Call the processor's UpgradeToXXX() method corresponding to the signature level you want to get.
Note that some UpgradeXXX() methods require a timestamping client object.
In such case you will have to create one before calling UpgradeToXXX().
processor.UpgradeToT(tspClient);
-
Once the signature is upgraded, save the updated CMS by calling TElSignedCMSMessage.Save().
Note, in some cases it makes sense to check whether the signature can be upgraded to a certain level before trying to upgrade it.
You can perform this check using the processor's CanUpgradeToXXX() method:
if (processor.CanUpgradeToBaselineLTA())
{
processor.UpgradeToBaselineLTA(tspClient);
}
How To articles about CAdES
Discuss this help topic in SecureBlackbox Forum