Title: Article Title Goes Here Author: Author Name Email: author@email.com Environment: VC++ 5.0-6.0, NT 4.0, Win95/98 Keywords: Control, Dialog, MFC Level: Intermediate" Description: An article on something-or-other Section Miscellaneous SubSection General
makecert.exe
:
makecert -r -sv MyCert.pvk -n "CN=MyCert" -b 01/01/2000 -e 01/01/2099 MyCert.cerFor more information about
makecert.exe
parameters refer to MSDN library.signtool.exe
, so go on step 2.
pvk2pfx.exe
tool:
pvk2pfx.exe -pvk MyCert.pvk -spc MyCert.cer -pfx MyCert.pfxThe command will creates .pfx file (MyCert.pfx).
<?xml version="1.0" encoding="utf-8" ?> <wap-provisioningdoc> <characteristic type="CertificateStore"> <characteristic type="Privileged Execution Trust Authorities"> <characteristic type="[cert_sha1]"> <parm name="EncodedCertificate" value="[cert_base64]" /> </characteristic> </characteristic> </characteristic> <characteristic type="CertificateStore"> <characteristic type="SPC"> <characteristic type="[cert_sha1]"> <parm name="EncodedCertificate" value="[cert_base64]" /> <parm name="Role" value="222" /> </characteristic> </characteristic> </characteristic> </wap-provisioningdoc>This is the standard schema for our provisioningdoc.
openssl.exe
tool:
openssl sha1 MyCert.cer > MyCert_sha1.txt openssl base64 -in MyCert.cer > MyCert_base64.txtWith these commands we get two files with sha1 and base64 values of our certificate. So create an empty file '_setup.xml' and past the content into:
<?xml version="1.0" encoding="utf-8" ?> <wap-provisioningdoc> <characteristic type="CertificateStore"> <characteristic type="Privileged Execution Trust Authorities"> <characteristic type="2bd9dd0aadf266f9810a1210a2052144bf2e3f22"> <parm name="EncodedCertificate" value="MIIB8jCCAVugAwIBAgIQztL5fI8kyrFE9be6IfYcXTANBgkqhkiG9w0BAQQFADAS MRAwDgYDVQQDEwdDcmlTb2Z0MCAXDTk5MTIzMTIzMDAwMFoYDzIwOTgxMjMxMjMw MDAwWjASMRAwDgYDVQQDEwdDcmlTb2Z0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB iQKBgQDSNfTSjNJy4zZKi9wen/9CLt1cwWcYIaIp4xIuDd9VIXy3hBj+FpL11E9d O7Sa5FXcIo8P9WttLHkd9TS8GXUEJShU+b/JtPDQ3EvpuJcSpo0CEuAI3fr7+LpI VtfZto+lA8/8Ch7cssZQqPaNClIP2+9DrR5l7t5XvCGLltfrcQIDAQABo0cwRTBD BgNVHQEEPDA6gBDsxeAuaLF3Ax+fxz0bWdqvoRQwEjEQMA4GA1UEAxMHQ3JpU29m dIIQztL5fI8kyrFE9be6IfYcXTANBgkqhkiG9w0BAQQFAAOBgQC2Tsg8FhGLhCgT IxKEErFzZw1bNxrnxAjao3hkA2jtv3jGkejWMnnBODogUPbwnkxRTlmKEjBhFilt P4c4djE4cDApXpnj26R7eX6PmhPmvJHRJP4JM8WEzq/saWyCBEyfhslSSKCVQeNS SJZ6//5FFqAJIQZ8DklQpSP6mIG3mw==" /> </characteristic> </characteristic> </characteristic> <characteristic type="CertificateStore"> <characteristic type="SPC"> <characteristic type="2bd9dd0aadf266f9810a1210a2052144bf2e3f22"> <parm name="EncodedCertificate" value="MIIB8jCCAVugAwIBAgIQztL5fI8kyrFE9be6IfYcXTANBgkqhkiG9w0BAQQFADAS MRAwDgYDVQQDEwdDcmlTb2Z0MCAXDTk5MTIzMTIzMDAwMFoYDzIwOTgxMjMxMjMw MDAwWjASMRAwDgYDVQQDEwdDcmlTb2Z0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB iQKBgQDSNfTSjNJy4zZKi9wen/9CLt1cwWcYIaIp4xIuDd9VIXy3hBj+FpL11E9d O7Sa5FXcIo8P9WttLHkd9TS8GXUEJShU+b/JtPDQ3EvpuJcSpo0CEuAI3fr7+LpI VtfZto+lA8/8Ch7cssZQqPaNClIP2+9DrR5l7t5XvCGLltfrcQIDAQABo0cwRTBD BgNVHQEEPDA6gBDsxeAuaLF3Ax+fxz0bWdqvoRQwEjEQMA4GA1UEAxMHQ3JpU29m dIIQztL5fI8kyrFE9be6IfYcXTANBgkqhkiG9w0BAQQFAAOBgQC2Tsg8FhGLhCgT IxKEErFzZw1bNxrnxAjao3hkA2jtv3jGkejWMnnBODogUPbwnkxRTlmKEjBhFilt P4c4djE4cDApXpnj26R7eX6PmhPmvJHRJP4JM8WEzq/saWyCBEyfhslSSKCVQeNS SJZ6//5FFqAJIQZ8DklQpSP6mIG3mw==" /> <parm name="Role" value="222" /> </characteristic> </characteristic> </characteristic> </wap-provisioningdoc>We're ready to build our cab to deploy on our devices.
makecab.exe
tool:
makecab.exe _setup.xml mycert_cert.cabOur certificate is now ready to install on devices!
makecab.exe
tool:
makecab.exe _setup.xml mycert_cert.cabOur certificate is now ready to install on devices!
Did you learn anything interesting/fun/annoying while writing the code? Did you do anything particularly clever or wild or zany?
Keep a running update of any changes or improvements you've made here.