Main Content

Simulink.ProtectedModel.sign

Attach digital signature to protected model

Since R2020a

Description

example

Simulink.ProtectedModel.sign(protectedModel,certificateFile) attaches a digital signature with the certificate certificateFile to the protected model protectedModel.

Examples

collapse all

Protect a model, and then digitally sign it with a certificate.

Open and protect the model that you want to sign. For this example, protect the model sldemo_mdlref_counter.

openExample('sldemo_mdlref_counter');
Simulink.ModelReference.protect('sldemo_mdlref_counter');

Locate the certificate file that you want to use to sign the protected model. Sign the model by using the certificate file.

Simulink.ProtectedModel.sign('sldemo_mdlref_counter.slxp','certificate_file.pfx');

In the dialog box, enter the password for the certificate file.

Input Arguments

collapse all

Name of the protected model that you want to sign, specified as a character vector or string scalar. The protected model has a .slxp extension.

Example: 'my_model.slxp'

Certificate file to use for signing the protected model, specified as a character vector or string scalar. The certificate must be a PKCS #12 file with the extension .pfx or .p12.

Example: 'my_cert.pfx'

Example: 'InstitutionCertificate.p12'

Version History

Introduced in R2020a