| 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. |
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 |
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 |
|
|