本文和大家重点讨论一下Black Berry开发代码签名工具申请及安装介绍,出于安全和出口控制的原因,Research In Motion(RIM)必须跟踪一些敏感Black Berry®应用程序编程接口(API)的使用情况。
Black Berry开发代码签名工具申请及安装介绍
Black Berry开发背景
出于安全和出口控制的原因,Research In Motion(RIM)必须跟踪一些敏感Black Berry®应用程序编程接口(API)的使用情况。敏感类别或方法在API参考文档中使用“锁定”图标或“Signed”字样表示。如果您在应用程序中使用了这些受控类,在您将应用程序.cod文件加载到Black Berry智能手机之前,您的应用程序必须使用签名工具(由RIM提供)进行签名。完成注册流程需要提供有效的信用卡,将收取管理费20美元。官网介绍:http://cn.blackberry.com/developers/javaappdev/codekeys.jsp
一、概述
在Black Berry开发中,如果您的应用程序使用了受控API,在加载到Blackberry智能手机之前,必须使用RIM提供的签名密钥对其进行签名,签名所用的key需要向RIM申请。本文档介绍RIM签名的申请过程及在公司共用一个签名情况下的环境搭建。
注意:仅当要在BlackBerry智能手机上运行应用程序时,才需要对应用程序进行注册和签名。使用Blackberry智能手机模拟器运行应用程序时不需要对其进行签名。
二、签名申请
要注册以获得BlackBerry运行时、应用程序和加密API,您需要填写这一Web表单。注册完成后,您将会通过电子邮件收到一系列密钥和相关安装说明,可用于使用BlackBerry签名工具对您的应用程序进行签名。完成注册流程需要提供有效的信用卡,将收取管理费20美元。
注意:通常,密钥会在提交必要表单后的48小时内发送到您的电子邮箱,但有时这一过程也会花费长达10个工作日的时间。中国申请的签名,一般需要5到10个工作日的时间。因为密钥会作为附件发送到邮箱,因此所使用的邮箱需要避免将该邮件作为垃圾邮件过滤或者自动删除附件。
BlackBerry开发签名申请前请准备:
1)接收密钥的邮箱
2)具有美元消费功能的信用卡(国内的信用卡,Vista和Master)
签名申请的URL为:https://www.blackberry.com/SignedKeys/
需要填写以下表单1:
对于中国的姓名,一般来说,firstname是名,lastname是姓,这个对签名的申请不是关键。接下来的company填写公司的英文名称,Email填写要接收密钥的邮箱,phone填写个人的电话号码,Address、city作为公司的话,填写公司的地址,province一般保持原样,country选择china,postal/zipcode填写邮政编码,Quantity不需要填写。
接下来填写第二个表单2:
PIN是指自己定义的密码,10位数字,请牢记该密码,在后续接收到RIM的密钥后会用到。接下去关于YES/NO的选项是关于RIM引用加密API相关,可以进一步了解,一般选择NO就可以。
再接下去是信用卡信息,注意要填写正确,CardHolderName信用卡持有人的姓名是指信用卡正面的英文名。CardHolderPhone指信用卡持有人的电话,一般直接填写个人的电话号码即可,CardHolderEmail指信用卡持有人的Email,可以和上面表单一样,CreditCardType信用卡的类型,信用卡正面可以找到;CreditCardNumber信用卡号码,ExpirationDate信用卡过期时间,在信用正面可以找到,CreditCardsecurityNumber信用卡安全号只信用卡背面的三位数字。如果对信用卡各项内容不清楚,可以从发卡行的网站或者银行信用卡电话寻求帮助。
填写提交之后,会出现一个总结性的页面,在这个页面要求用户确认,最好拷贝或者记录各项信息,页面下面有最终的提交按钮,按下之后将不可撤销。在提交之后,一般国内的信用卡消费美元会给你电话确认(如果出现这个,申请成功的可能性就会很大)。
注意:在申请成功提交之后,会出现$30的信用卡交易,RIM的回答如下:
theinitial$30chargeisaholdingfeeplacedbythecreditcardcompanytoverifythatthefundsareavailableforthetransaction,thisamountishigherthanthelisted$20feetoaccountforcurrencychanges,taxesetc.Thisisatemporaryvalueandwillnotremainonyourbill,theactualamountforthekeysis$20US.
大概意思是$30类似于在用信用卡入住酒店时的冻结资金,实际金额在成交之后按照$20结算。
到此,申请的过程完结,接下去需要等待RIM答复,注意,5-10天是指工作日,而非自然日。
三、BlackBerry开发签名工具环境搭建
在成功申请后,RIM会发若干封邮件,其中至少有三封包含附件的邮件,三个附件分别为:
client-RBB-XXXXXXXXXX.csi
client-RCR-XXXXXXXXXX.csi
client-RRT-XXXXXXXXXX.csi
其中XXXXXXXXXX是指申请签名的clientID。三个附件为RBB,RRTandRCRkeys.
每封邮件都介绍有附件的使用方法,按照里面的步骤安装签名就可以了。内容如下:
复制
ThefollowingattachmentwillallowtheBlackBerrySignatureTooltoregisterwiththeSigningAuthority. PleaseensurethattheBlackBerrydevelopmenttoolofchoicehasbeeninstalledontotheworkstationthatwillbeusedtosignyourBlackBerryapplications. Toregistertheattachment,pleasefollowtheinstructionsbelow: IfyouplantouseboththeBlackBerryJDEandBlackBerryJDEPlug-inforEclipseinstallthesignaturekeysusingtheBlackBerryJDE. Thisshouldallowyoutosignfromeithertool. BlackBerryJDEorBlackBerryJDEComponentPackageUsers: 1)Double-clickontheattachment. 2)Ifadialogboxappearsthatstatesthataprivatekeycannotbefound,completesteps3through6beforeyoucontinue.Otherwise,proceedtostep7. 3)Click"Yes"tocreateanewkeypairfile. 4)Typeapasswordforyourprivatekeyofatleast8characters,andtypeitagaintoconfirm.Thisisyourprivatekeypassword, whichprotectsyourprivatekey.Pleaserememberthispasswordasyouwillbepromptedforiteachtimesigningisattemptedorasignaturekeyisinstalled. 5)Click"Ok" 6)Moveyourmousetogeneratedateforanewprivatekey. 7)Inthe"RegistrationPIN"field,typethePINnumberthatyousuppliedonthesignaturekeyorderform. 8)InthePrivateKeypasswordfield,typethepasswordcreatedinstep4. 9)Click"Register". 10)Click"Exit". 11)Repeatthisprocessfortheother.csifiles. BlackBerryJDEPlug-inforEclipseUsers: 1)Saveall3.csifilesinthesamedirectory(eachonewillbesentinaseparateemailmessage). 2)StartEclipse. 3)ClickontheBlackBerrymenuandchooseInstallSignatureKeys. 4)Selectoneofthe3.csifilessavedinstep1andclickOpen. 5)Click"Yes"tocreateanewkeypairfile. 6)Typeapasswordforyourprivatekeyofatleast8characters,andtypeitagaintoconfirm. Thisisyourprivatekeypassword,whichprotectsyourprivatekey.Pleaserememberthispasswordasyouwillbepromptedforiteachtimesigningisattemptedorasignaturekeyisinstalled. 7)Moveyourmousetogeneratedateforanewprivatekey. 8)IntheRegistrationPIN"field,typethePINnumberthatyousuppliedonthesignaturekeyorderform. 9)InthePrivateKeypasswordfield,typethepasswordcreatedinstep6. 10)Click"Register". 11)Click"Exit". 12)Repeatthisprocessfortheothercsifiles. BlackBerryWidgetSDK,BlackBerryWebDevelopmentPlug-inforEclipseorBlackBerryPlug-inforMicrosoftVisualStudioUsers: 1)Atthecommandprompt,navigatetothebinfolderwithintheBlackBerryWidgetPackagerinstallationdirectory.Defaultdirectoriesare: BlackBerryWidgetSDKandBlackBerryPlug-inforMicrosoftVisualStudio: C:\ProgramFiles\ResearchInMotion\BlackBerryWidgetPackager\binBlackBerryWebDevelopmentPlug-inforEclipse: <EclipseInstallation>\plugins\net.rim.browser.tools.wcpc\wcpc\binC:\ProgramFiles\ResearchInMotion\BlackBerryWidgetPackager\bin 2)Typethefollowingcommand,includingthefullpathofthe.csifile: java-jarSignatureTool.jar<.csifilepath> 3)Ifadialogthataprivatekeycannotbefoundappears,performthefollowingactions: a.ClickYes. b.Typeapasswordfortheprivatekey. c.Typethepasswordtoconfirmit. d.ClickOK. e.Movethemousetogeneratedataforthenewprivatekey. 4)IntheRegistrationPINfield,typethePINthatRIM.provided. 5)InthePrivateKeyPasswordfield,typeapasswordofatleasteightcharacters.Thisistheprivatekeypassword. 6)ClickRegister. 7)ClickExit. Importantinformationforallusers: Note:All3keys(RBB,RCR,RRT)receivedneedtobeinstalledonthesamePC.ThesamepasswordmustbespecifiedforallkeysonthesamePC.Youshouldreceiveeachkey/.csifileinaseparateemailmessage. ForfurtherinformationonBlackBerryControlledAPIsandsigningofapplications,pleaserefertotheBlackBerrySignatureToolDeveloperGuideversion4.2.0,foundatthefollowinglink: http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/8067/645045/8655/8656/1271077/BlackBerry_Signature_Tool_Developer_Guide.pdf?nodeid=1271325&vernum=0 Pleasenote:Whenregisteringwiththesigningauthority,ensurethatyouhavecorrectlyenteredyourregistrationPINnumber.IfyouentertheincorrectPIN5times,yourkeyswillbedeactivated. Troubleshooting: IfyouarehavingdifficultyinstallingorregisteringyoursignaturekeyspleasechecktheSignatureKeyandCodesigningsectionoftheDeveloperKnowledgeBasefoundhere:http://www.blackberry.com/knowledgecenterpublic/livelink.exe?func=ll&objId=800989&objAction=browse&sort=name Ifyoucontinuetoexperienceissuespleasecontactdevsupport@rim.com. BestofluckwithyourdevelopmentandthankyouforyourinterestinBlackBerry. Regards,BlackBerryApplicationDevelopmentSupportTeamhttp://www.blackberrydeveloper.com DateIssued:Tuesday,March16,2010@14:54:15KeysIssued:RRT Recipient:youremail@rim.com <<client-RRT-207634362.csi>> --------------------------------------------------------------------- Thistransmission(includinganyattachments)maycontainconfidentialinformation,privilegedmaterial(includingmaterialprotectedbythesolicitor-clientorotherapplicableprivileges),orconstitutenon-publicinformation.Anyuseofthisinformationbyanyoneotherthantheintendedrecipientisprohibited.Ifyouhavereceivedthistransmissioninerror, pleaseimmediatelyreplytothesenderanddeletethisinformationfromyoursystem. Use,dissemination,distribution,orreproductionofthistransmissionbyunintendedrecipientsisnotauthorizedandmaybeunlawful.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
注意事项:
1.如果希望签名工具能够同时支持BlackBerryJDE和BlackBerryJavaPluginforEclipse,需要先为BlackBerryJDE安装
2.每次要签名应用的时候,就拷贝cod和csl文件到该机器,打开cod文件完成签名。
3.如果需要卸载JDE重新安装,一定要预先备份以下三个文件
【编辑推荐】