5.7.10. SE05X Import Transient objects

Before running this example, please run Section 5.7.9 SE05X Export Transient objects

This example does following steps:

  • Re-Generates a Transient ECC Key at the same location as created by SE05X Export Transient objects

  • Tries to verify previously signed data. (This must fail, because key is over-written)

  • Imports previously exported key inside the SE.

  • Tries to verify previously signed data. (This must be seccessful, because it is the same key)

Note

This example needs File system access and hence it is not applicable for embedded platforms.

The exported files are current working directory.

5.7.10.1. Visual Studio - Debug settings

Kindly set debug Working Directory to $(TargetDir) in project’s debug stettings. This ensures that the examples SE05X Export Transient objects and SE05X Import Transient objects work seamlessly.

5.7.10.2. Console output

If everything is successful, the output will be similar to:

App   :INFO :Running Example ex_sss_import.c
App   :INFO :Object exists!!!
App   :INFO :This verify must fail, because keys are different
App   :INFO :Reading contents form 'export_serializedSingedData.bin'
App   :WARN :Verification Failed!
App   :WARN :nxEnsure:'status == kStatus_SSS_Success' failed. At Line:196 Function:ExampleDoVerify
App   :INFO :Reading contents form 'export_serializedECKey.bin'
App   :INFO :This verify must pass, because keys are same
App   :INFO :Reading contents form 'export_serializedSingedData.bin'
App   :INFO :Verification Successful.
App   :INFO :ex_sss_import Example Success !!!...
App   :INFO :ex_sss Finished