Java Doc for MEKeyTool.java in  » 6.0-JDK-Modules » j2me » com » sun » midp » mekeytool » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » com.sun.midp.mekeytool 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.midp.mekeytool.MEKeyTool

MEKeyTool
public class MEKeyTool (Code)
Manages the initial public keystore needed to bootstrap this MIDP security implementation. It provides both a Java and a command line interface.

The anchor of trust on an ME (mobile equipment) are the public keys loaded on it by the manufacturer, in MIDP implementation this is known as the ME keystore. This tool does for the MIDP implementation what the manufacturer must do for the ME so that trusted MIDP applications can be authenticated.
See Also:   MEKeyTool.main(String[])




Constructor Summary
public  MEKeyTool()
     Constructs a MEKeyTool with an empty keystore.
public  MEKeyTool(String meKeystoreFilename)
     Constructs a MEKeyTool and loads its keystore using a filename.
public  MEKeyTool(File meKeystoreFile)
     Constructs a MEKeyTool and loads its keystore from a file.
public  MEKeyTool(InputStream meKeystoreStream)
     Constructs a MEKeyTool and loads its keystore from a stream.

Method Summary
public  booleandeleteKey(String owner)
     Deletes the first public key matching the owner's distinguished name.
public  voiddeleteKey(int number)
     Deletes a key by key number, 0 being the first public key.
public static  StringformatKeyInfo(PublicKeyInfo keyInfo)
     Creates a string representation of a key that is displayed to a user during a list command.
protected  PublicKeyInfogetFirstKey()
     Gets the first key in the keystore.
public  PublicKeyStoreBuilderBasegetKeystore()
     Gets the read-write keystore this tool is manipulating.
protected  PublicKeyInfogetNextKey()
     Gets the next key after the previous one returned by MEKeyTool.getFirstKey or this method.
public  voidimportKeyFromJcaKeystore(String jcakeystoreFilename, String keystorePassword, String alias, String domain)
     Copies a key from a Standard Edition keystore into the ME keystore.
public  voidimportKeyFromJcaKeystore(KeyStore jcaKeystore, String alias, String domain)
     Copies a key from a Standard Edition keystore into the ME keystore.
public static  voidmain(String[] args)
     Performs the command specified in the first argument.
public  voidsaveKeystore(File meKeystoreFile)
     Saves the keystore to a file.


Constructor Detail
MEKeyTool
public MEKeyTool()(Code)
Constructs a MEKeyTool with an empty keystore.



MEKeyTool
public MEKeyTool(String meKeystoreFilename) throws FileNotFoundException, IOException(Code)
Constructs a MEKeyTool and loads its keystore using a filename.
Parameters:
  meKeystoreFilename - serialized keystore file
exception:
  FileNotFoundException - if the file does not exist, is adirectory rather than a regular file, or for some other reasoncannot be opened for reading.
exception:
  IOException - if the key storage was corrupted



MEKeyTool
public MEKeyTool(File meKeystoreFile) throws FileNotFoundException, IOException(Code)
Constructs a MEKeyTool and loads its keystore from a file.
Parameters:
  meKeystoreFile - serialized keystore file
exception:
  FileNotFoundException - if the file does not exist, is adirectory rather than a regular file, or for some other reasoncannot be opened for reading.
exception:
  IOException - if the key storage was corrupted



MEKeyTool
public MEKeyTool(InputStream meKeystoreStream) throws IOException(Code)
Constructs a MEKeyTool and loads its keystore from a stream.
Parameters:
  meKeystoreStream - serialized keystore stream
exception:
  IOException - if the key storage was corrupted




Method Detail
deleteKey
public boolean deleteKey(String owner)(Code)
Deletes the first public key matching the owner's distinguished name.
Parameters:
  owner - name of the key's owner true, if the key was deleted, else false



deleteKey
public void deleteKey(int number)(Code)
Deletes a key by key number, 0 being the first public key.
Parameters:
  number - number of the key
exception:
  ArrayIndexOutOfBoundsException - if an invalid number wasgiven.



formatKeyInfo
public static String formatKeyInfo(PublicKeyInfo keyInfo)(Code)
Creates a string representation of a key that is displayed to a user during a list command. The string does not include the modulus and exponent.
Parameters:
  keyInfo - key to display printable representation of the key



getFirstKey
protected PublicKeyInfo getFirstKey()(Code)
Gets the first key in the keystore. all the information related to the first key



getKeystore
public PublicKeyStoreBuilderBase getKeystore()(Code)
Gets the read-write keystore this tool is manipulating. For advanced users. read-write keystore



getNextKey
protected PublicKeyInfo getNextKey()(Code)
Gets the next key after the previous one returned by MEKeyTool.getFirstKey or this method. If getFirstKey is not called before the first call to this method, null will be returned. all the information related to the next key, or null ifthere are no more keys



importKeyFromJcaKeystore
public void importKeyFromJcaKeystore(String jcakeystoreFilename, String keystorePassword, String alias, String domain) throws IOException, GeneralSecurityException(Code)
Copies a key from a Standard Edition keystore into the ME keystore.
Parameters:
  jcakeystoreFilename - name of the serialized keystore
Parameters:
  keystorePassword - password to unlock the keystore
Parameters:
  alias - the ID of the key in the SE keystore
Parameters:
  domain - security domain of any application authorizedwith the corresponding private key



importKeyFromJcaKeystore
public void importKeyFromJcaKeystore(KeyStore jcaKeystore, String alias, String domain) throws IOException, GeneralSecurityException(Code)
Copies a key from a Standard Edition keystore into the ME keystore.
Parameters:
  jcaKeystore - loaded JCA keystore
Parameters:
  alias - the ID of the key in the SE keystore
Parameters:
  domain - security domain of any application authorizedwith the corresponding private key



main
public static void main(String[] args)(Code)
Performs the command specified in the first argument.

Exits with a 0 status if the command was successful. Exits and prints out an error message with a -1 status if the command failed.

 MEKeyTool supports the following commands:
 no args  - same has -help
 -import  - import a public key from a JCE keystore
 into a ME keystore
 -delete  - delete a key from a ME keystore
 -help    - print a usage summary
 -list    - list the owner and validity period of each
 key in a ME keystore
 Parameters for (commands):
 -MEkeystore <filename of the ME keystore> (optional for all)
 -keystore   <filename of the JCA keystore> (optional import)
 -storepass  <password for the JCA keystore> (optional import)
 -alias      <short string ID of a key in a JCA keystore> (import)
 -domain     <security domain of the ME key> (optional import)
 -owner      <name of the owner of a ME key> (delete)
 -number     <key number starting a 1 of a ME key> (delete)
 Defaults:
 -MEkeystore appdir/main.ks
 -keystore   <user's home dir>/.keystore
 -domain     untrusted
 

Parameters:
  args - command line arguments



saveKeystore
public void saveKeystore(File meKeystoreFile) throws IOException(Code)
Saves the keystore to a file.
Parameters:
  meKeystoreFile - serialized keystore file



Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.