Package java.security

Examples of java.security.GeneralSecurityException


        throw new IllegalArgumentException("Encrypted data not Serializable");
      }
      return (Serializable) obj;
    }
    catch(final IOException ioe) {
      throw new GeneralSecurityException("Error attempting to de-serialize object: " + ioe.getMessage());
    }
  }
View Full Code Here


                if (keyManagers[idx] instanceof X509KeyManager) {
                    try {
                        ret[idx] = new AliasedX509ExtendedKeyManager(tlsClientParameters.getCertAlias(),
                                                                             (X509KeyManager)keyManagers[idx]);
                    } catch (Exception e) {
                        throw new GeneralSecurityException(e);
                    }
                } else {
                    ret[idx] = keyManagers[idx];
                }
            }
View Full Code Here

    ContentSigner signer;
    try {
      signer = new JcaContentSignerBuilder(sigAlg(keyPair)).build(keyPair
          .getPrivate());
    } catch (OperatorCreationException e) {
      throw new GeneralSecurityException(e);
    }
    JcaX509v1CertificateBuilder builder = new JcaX509v1CertificateBuilder(
        subject, BigInteger.ONE, notBefore, notAfter, subject,
        keyPair.getPublic());
    X509CertificateHolder holder = builder.build(signer);
View Full Code Here

  {
     RSAPublicKey pkey = (RSAPublicKey) this.certificates[0].getPublicKey();
     RSAPrivateKey prkey = (RSAPrivateKey) userKey;
   
     if (!pkey.getModulus().equals(prkey.getModulus())) {
       throw new GeneralSecurityException(
         "Certificate and private key specified do not match");
     }
 
  }
View Full Code Here

      }

      userKey = key.getPrivateKey();

    } catch (IOException e) {
      throw new GeneralSecurityException("Error: Failed to load key: " + keyPath);
    } catch (GeneralSecurityException e) {
      throw new GeneralSecurityException("Error: Wrong pass phrase");
    }
  }
View Full Code Here

                        {
                            serverInstance = createBougusServerSSLContext();
                        }
                        catch( Exception ioe )
                        {
                            throw new GeneralSecurityException(
                                    "Can't create Server SSLContext:" + ioe );
                        }
                    }
                }
            }
View Full Code Here

                        {
                            serverInstance = createBougusServerSSLContext();
                        }
                        catch( Exception e )
                        {
                            throw new GeneralSecurityException(
                                    "Can't create Server SSLContext.", e );
                        }
                    }
                }
            }
View Full Code Here

    }

    public SSLContext createSSLContext(String provider, String protocol, String algorithm, String keyStore, String keyAlias, String trustStore, long timeout) throws GeneralSecurityException {

        if (!this.checkForKeystoresAvailability(keyStore, keyAlias, trustStore, timeout)) {
            throw new GeneralSecurityException("Unable to lookup configured keystore and/or truststore");
        }

        KeystoreInstance keyInstance = getKeystore(keyStore);
        if (keyInstance != null && keyInstance.isKeystoreLocked()) {
            throw new KeystoreIsLocked("Keystore '" + keyStore + "' is locked");
View Full Code Here

            "New message",
            "Long message for Exception. Long message for Exception. Long message for Exception." };

    protected Object[] getData() {
        Exception cause = new Exception(msgs[1]);
        GeneralSecurityException dExc = new GeneralSecurityException(msgs[0], cause);
        String msg = null;
        Throwable th = null;
        return new Object[] { new GeneralSecurityException(), new GeneralSecurityException(msg),
                new GeneralSecurityException(msgs[1]),
                new GeneralSecurityException(new Throwable()), new GeneralSecurityException(th),
                new GeneralSecurityException(msgs[1], dExc) };
    }
View Full Code Here

                        {
                            serverInstance = createBougusServerSSLContext();
                        }
                        catch( Exception ioe )
                        {
                            throw new GeneralSecurityException(
                                    "Can't create Server SSLContext:" + ioe );
                        }
                    }
                }
            }
View Full Code Here

TOP

Related Classes of java.security.GeneralSecurityException

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.