Package java.security

Examples of java.security.InvalidKeyException.initCause()


      final X509EncodedKeySpec xspec = new X509EncodedKeySpec(new DERBitString(subjectPKInfo).getBytes());
      final AlgorithmIdentifier keyAlg = subjectPKInfo.getAlgorithmId ();
      return KeyFactory.getInstance(keyAlg.getObjectId().getId (), provider).generatePublic(xspec);
    } catch (java.security.spec.InvalidKeySpecException e) {
      final InvalidKeyException newe = new InvalidKeyException("Error decoding public key.");
      newe.initCause(e);
      throw newe;
    }
  }
 
    /** force a password, i.e. ignore the password in the request
View Full Code Here


            this.encodedKey = (byte[])encodedKey.clone();

        } catch (NumberFormatException e) {
            InvalidKeyException ike = new InvalidKeyException(
                "Private-value length too big");
            ike.initCause(e);
            throw ike;
        } catch (IOException e) {
            InvalidKeyException ike = new InvalidKeyException("Error parsing key encoding: " + e.getMessage());
            ike.initCause(e);
            throw ike;
View Full Code Here

                "Private-value length too big");
            ike.initCause(e);
            throw ike;
        } catch (IOException e) {
            InvalidKeyException ike = new InvalidKeyException("Error parsing key encoding: " + e.getMessage());
            ike.initCause(e);
            throw ike;
        }
    }

    /**
 
View Full Code Here

        try {
            DerInputStream in = new DerInputStream(this.key);
            this.x = in.getBigInteger();
        } catch (IOException e) {
            InvalidKeyException ike = new InvalidKeyException("Error parsing key encoding: " + e.getMessage());
            ike.initCause(e);
            throw ike;
        }
    }

    /**
 
View Full Code Here

                                       pKey.getEncoded().length*8);
                    return new PBKDF2KeyImpl(spec, "HmacSHA1");
                } catch (InvalidKeySpecException re) {
                    InvalidKeyException ike = new InvalidKeyException
                        ("Invalid key component(s)");
                    ike.initCause(re);
                    throw ike;
                }
            }
        }
        throw new InvalidKeyException("Invalid key format/algorithm");
View Full Code Here

                                                   encodedKeyAlgorithm +
                                                   "algorithm");
            } catch (InvalidKeySpecException ikse2) {
                InvalidKeyException ike =
                    new InvalidKeyException("Cannot construct public key");
                ike.initCause(ikse2);
                throw ike;
            }
        } catch (InvalidKeySpecException ikse) {
            InvalidKeyException ike =
                new InvalidKeyException("Cannot construct public key");
View Full Code Here

                throw ike;
            }
        } catch (InvalidKeySpecException ikse) {
            InvalidKeyException ike =
                new InvalidKeyException("Cannot construct public key");
            ike.initCause(ikse);
            throw ike;
        } catch (NoSuchProviderException nspe) {
            // Should never happen.
        }
View Full Code Here

                                                   encodedKeyAlgorithm +
                                                   "algorithm");
            } catch (InvalidKeySpecException ikse2) {
                InvalidKeyException ike =
                    new InvalidKeyException("Cannot construct private key");
                ike.initCause(ikse2);
                throw ike;
            }
        } catch (InvalidKeySpecException ikse) {
            InvalidKeyException ike =
                new InvalidKeyException("Cannot construct private key");
View Full Code Here

                throw ike;
            }
        } catch (InvalidKeySpecException ikse) {
            InvalidKeyException ike =
                new InvalidKeyException("Cannot construct private key");
            ike.initCause(ikse);
            throw ike;
        } catch (NoSuchProviderException nspe) {
            // Should never happen.
        }
View Full Code Here

                               x.toByteArray()).toByteArray();
            encode();
        } catch (IOException e) {
            InvalidKeyException ike = new InvalidKeyException(
                "could not DER encode x: " + e.getMessage());
            ike.initCause(e);
            throw ike;
        }
    }

    /**
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.