保護モデルに対して、デジタル署名の機能を試したいのですが、お金がかからない手順はありますか?
1 view (last 30 days)
Show older comments
MathWorks Support Team
on 16 Mar 2023
Answered: MathWorks Support Team
on 16 Mar 2023
保護モデルに対して、デジタル署名の機能を試したいです。
お金がかからない手順を教えてください。
Accepted Answer
MathWorks Support Team
on 16 Mar 2023
テスト用の自己署名入り証明書の作り方は以下の流れになります。
(あくまでも一例になります。)
1)下記を含むopenssl.cnfファイルを作成
[ req ]
x509_extensions = req_x509_extensions
[ req_x509_extensions ]
basicConstraints = CA:true
keyUsage = digitalSignature, keyCertSign
2)OpenSSLをインストール後、Windowsのdos上で下記を実行します。
openssl genrsa -out key.pem 2048
openssl req -new -sha256 -key key.pem -out csr.csr
openssl req -x509 -sha256 -days 365 -key key.pem -in csr.csr -out certificate.pem -config openssl.cnf
openssl pkcs12 -export -out client-identity.pfx -inkey key.pem -in certificate.pem
*client-identity.pfxが作成されます。
*この例では、パスワードに test を使っています。
3)MATLABのコマンドウインドウ上で、
>> Simulink.ModelReference.ProtectedModel.setPasswordForCertificate('client-identity.pfx', 'test');
>> Simulink.ProtectedModel.sign('Controller0.slxp','client-identity.pfx');
を実行します。
なお、上記の場合、自己署名証明書なので、下記警告メッセージが表示されます。
警告: 'Controlleraaa.slxp' に追加されたデジタル署名を検証できませんでした。原因: 'AAAA' の証明書
は、自分自身によって発行されています。
OpenSSLの使い方につきましては、Google検索等でご確認ください。
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!