![]() |
Platforms, Frameworks & Libraries »
Mobile Development »
General
Intermediate
Sign codeBy crinoHow sign the code by own certificate and install the certificate on device. |
C++, Windows, Win Mobile, Mobile, Visual Studio, Dev
|
||||||||||
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||
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="30bc827f441fa4437b645163e49ade7226b362c3"> <parm name="EncodedCertificate" value="MIIB7zCCAVigAwIBAgIQSZfc9OLump1HzDNpsZ2edTANBgkqhkiG9w0BAQQFADAR MQ8wDQYDVQQDEwZNeUNlcnQwIBcNOTkxMjMxMjMwMDAwWhgPMjA5ODEyMzEyMzAw MDBaMBExDzANBgNVBAMTBk15Q2VydDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkC gYEAx6QQIhONxvNHrK+p1qgy/AY3/Q/rf7XGvMYmxENAdQFjgP2CpH/1Bgsa8MwK XxViZqW2DbixDas77M+cG3BnxtdK42xuhBlzVCq8wiOh7/q9SZp9wKj94c7k5jok L1BgHT2dH2DHUgnxG6Y9mvowX/DJ8gvbNKR1p4FQpK74NvUCAwEAAaNGMEQwQgYD VR0BBDswOYAQfyce0/6l1q4oeResHzIEZ6ETMBExDzANBgNVBAMTBk15Q2VydIIQ SZfc9OLump1HzDNpsZ2edTANBgkqhkiG9w0BAQQFAAOBgQAEqy6rTbjmV/6zgYBY +gQQqBHf4GMvyEUR9g5+p/esG7GDve/qbZ4bm1BOSdRfgzMsda2guciMD54QPHNp k+wdE0tSuQN90Dla8109GmTdFyZkVezSDmuCkbX0BjQW2dJ6egvGG2mnA7Q6/5yt 4ftcV6hExesZviGUKXdBhBM2Dg==" /> </characteristic> </characteristic> </characteristic> <characteristic type="CertificateStore"> <characteristic type="SPC"> <characteristic type="30bc827f441fa4437b645163e49ade7226b362c3"> <parm name="EncodedCertificate" value="MIIB7zCCAVigAwIBAgIQSZfc9OLump1HzDNpsZ2edTANBgkqhkiG9w0BAQQFADAR MQ8wDQYDVQQDEwZNeUNlcnQwIBcNOTkxMjMxMjMwMDAwWhgPMjA5ODEyMzEyMzAw MDBaMBExDzANBgNVBAMTBk15Q2VydDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkC gYEAx6QQIhONxvNHrK+p1qgy/AY3/Q/rf7XGvMYmxENAdQFjgP2CpH/1Bgsa8MwK XxViZqW2DbixDas77M+cG3BnxtdK42xuhBlzVCq8wiOh7/q9SZp9wKj94c7k5jok L1BgHT2dH2DHUgnxG6Y9mvowX/DJ8gvbNKR1p4FQpK74NvUCAwEAAaNGMEQwQgYD VR0BBDswOYAQfyce0/6l1q4oeResHzIEZ6ETMBExDzANBgNVBAMTBk15Q2VydIIQ SZfc9OLump1HzDNpsZ2edTANBgkqhkiG9w0BAQQFAAOBgQAEqy6rTbjmV/6zgYBY +gQQqBHf4GMvyEUR9g5+p/esG7GDve/qbZ4bm1BOSdRfgzMsda2guciMD54QPHNp k+wdE0tSuQN90Dla8109GmTdFyZkVezSDmuCkbX0BjQW2dJ6egvGG2mnA7Q6/5yt 4ftcV6hExesZviGUKXdBhBM2Dg==" /> <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!
signtool.exe tool: signtool.exe sign /f MyCert.pfx *.exe *.cab
or
signcode -v MyCert.pvk -spc MyCert.cer *.exeWith these simple five steps we've our certificate applications!
19/12/2005 - Initial article.
30/12/2005 - Corrected the command line on Step 5
31/12/2005 - Regenerated the certificate and updated zip file
15/11/2006 - Added command line in Step 5 and updated zip file with signcode.exe tool.
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 15 Nov 2006 Editor: |
Copyright 2005 by crino Everything else Copyright © CodeProject, 1999-2009 Web20 | Advertise on the Code Project |