Package javax.microedition.pki

Examples of javax.microedition.pki.UserCredentialManagerException


            keyUsage != UserCredentialManager.KEY_USAGE_NON_REPUDIATION) {
                throw new IllegalArgumentException("Invalid key usage");
        }

        if (! algorithm.equals(UserCredentialManager.ALGORITHM_RSA)) {
            throw new UserCredentialManagerException(
                    UserCredentialManagerException.SE_NO_KEYS);
        }

        int slotCount = APDUManager.getSlotCount();

        while (true) {

            for (int i = 0; i < slotCount; i++) {

                WIMApplication w = WIMApplication.getInstance(
                        classSecurityToken, i, securityElementID, false);
                if (w == null) {
                    continue;
                }
                try {
                    Vector CSRs = loadCSRList();
                    byte[] CSR = w.generateCSR(nameInfo, keyLen,
                                           keyUsage, forceKeyGen, CSRs);
                    storeCSRList(CSRs);
                    return CSR;
                } finally {
                    w.done();
                }
            }

            // WIM application is not found

            if (securityElementPrompt != null) {
                try {
                    if (MessageDialog.showMessage(classSecurityToken,
                        Resource.getString(ResourceConstants
             .JSR177_WIM_NOT_FOUND),
                        securityElementPrompt,
                        true) != -1) {
                        continue;
                    }
                } catch (InterruptedException e) {}
            }
            throw new UserCredentialManagerException(
                          UserCredentialManagerException.SE_NOT_FOUND);
        }
    }
View Full Code Here


                throw e;
            } finally {
                w.done();
            }
        }
        throw new UserCredentialManagerException(
                UserCredentialManagerException.CREDENTIAL_NOT_SAVED);
    }
View Full Code Here

                        return true;
                    }
                    if (result == WIMApplication.CANCEL) {
                        return false;
                    }
                    throw new UserCredentialManagerException(
                                         UserCredentialManagerException.
                                         CREDENTIAL_NOT_FOUND);
                } finally {
                    w.done();
                }
            }

            // WIM application is not found

            if (securityElementPrompt != null) {
                try {
                    if (MessageDialog.showMessage(classSecurityToken,
                            Resource.getString(
                                ResourceConstants.JSR177_WIM_NOT_FOUND),
                            securityElementPrompt,
                            true) != -1) {
                        continue;
                    }
                } catch (InterruptedException e) {}
            }
            throw new UserCredentialManagerException(
                          UserCredentialManagerException.SE_NOT_FOUND);
        }
    }
View Full Code Here

                        securityElementPrompt, true) != -1) {
                        continue;
                    }
                } catch (InterruptedException e) {}
            }
            throw new UserCredentialManagerException(
                          UserCredentialManagerException.SE_NOT_FOUND);
        }
    }
View Full Code Here

  /* User requested a new key be generated. */
  if (forceKeyGen) {
      if (! UserCredentialManager.keygen) {
    // Configuration parameter disabled key generation.
    throw new UserCredentialManagerException
        (UserCredentialManagerException.SE_NO_KEYGEN);
      }
  }

        return com.sun.satsa.pki.PKIManager.generateCSR(nameInfo,
View Full Code Here

TOP

Related Classes of javax.microedition.pki.UserCredentialManagerException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.