By default, code signing keys for blackberry10 are stored in a default location in your system. The default locations of code signing keys vary based on operating system on your computer.
Below is detail about the default location as per different operating system
Windows XP : %HOMEPATH%\Local Settings\Application Data\Research In Motion
Windows Vista and Windows 7 : %HOMEPATH%\AppData\Local\Research In Motion
Mac OS : ~/Library/Research In Motion
HOMEPATH for different operating system is as below:
Windows xp : C:\Documents and Settings\user
Windows Vista and Windows 7 : C:\Users\user
Here below is the java program to get default location of code signing keys
- /**
- * Driver class
- * @author Sanjay Jain
- *
- */
- public class Driver {
- public static void main(String[] args) {
- try {
- String rimDir = getDefaultRIMDirLocation();
- System.out.println("Research In Motion Default Directory is:");
- System.out.println(rimDir);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- private static String getDefaultRIMDirLocation() {
- String osName = System.getProperty(Constants.OS_NAME);
- String fileSeparator = System.getProperty(Constants.FILE_SEPARATOR);
- String osVersion = System.getProperty(Constants.OS_VERSION);
- String userHome = System.getProperty(Constants.USER_HOME);
- String rimDirectory = Constants.RESEARCH_IN_MOTION;
- String dirName = "";
- // Check for mac
- if (osName.contains(Constants.MAC)) {
- dirName = userHome + fileSeparator + Constants.LIBRARY + fileSeparator
- + rimDirectory;
- } // Check for windows except windows xp
- else if (osName.contains(Constants.WINDOWS_VISTA)
- || osName.contains(Constants.VISTA)
- || osName.contains(Constants.WINDOWS_7)
- || osName.contains(Constants.WINDOWS_8)
- || osVersion.equals(Constants._6_2)) {
- dirName = userHome + fileSeparator + Constants.APP_DATA + fileSeparator
- + Constants.LOCAL + fileSeparator + rimDirectory;
- }
- // For windows xp
- else {
- dirName = userHome + fileSeparator + Constants.LOCAL_SETTINGS
- + fileSeparator + Constants.APPLICATION_DATA + fileSeparator + rimDirectory;
- }
- if (dirName.length() == 0) {
- dirName = userHome + fileSeparator + rimDirectory;
- }
- return dirName;
- }
- }
- /**
- * Constants class for holding all constants
- * @author Sanjay Jain
- *
- */
- public class Constants {
- static final String APPLICATION_DATA = "Application Data";
- static final String LOCAL_SETTINGS = "Local Settings";
- static final String APP_DATA = "AppData";
- static final String _6_2 = "6.2";
- static final String WINDOWS_8 = "Windows 8";
- static final String VISTA = "Vista";
- static final String WINDOWS_7 = "Windows 7";
- static final String WINDOWS_VISTA = "Windows Vista";
- static final String LIBRARY = "Library";
- static final String MAC = "Mac";
- static final String RESEARCH_IN_MOTION = "Research In Motion";
- static final String USER_HOME = "user.home";
- static final String OS_VERSION = "os.version";
- static final String FILE_SEPARATOR = "file.separator";
- static final String OS_NAME = "os.name";
- static final String LOCAL = "Local";
- }
For windows 7 and windows vista output will be as below:
Research In Motion Default Directory is:
C:\Users\user\AppData\Local\Research In Motion
For windows xp output will be as below
Research In Motion Default Directory is:
C:\Documents and Settings\user\Local Settings\Application Data\Research In Motion
For Mac OS output will be as below:
Research In Motion Default Directory is:
/Users/user/Library/Research In Motion
Your Suggestions Are Always Welcomed.
Image may be NSFW.Clik here to view.