@Override protected void engineSetMode(String modeStr) throws NoSuchAlgorithmException { final Mode mode; try { mode = Mode.valueOf(modeStr.toUpperCase(Locale.US)); } catch (IllegalArgumentException e) { NoSuchAlgorithmException newE = new NoSuchAlgorithmException("No such mode: " + modeStr); newE.initCause(e); throw newE; } checkSupportedMode(mode); this.mode = mode; }
@Override protected void engineSetMode(String modeStr) throws NoSuchAlgorithmException { final Mode mode; try { mode = Mode.valueOf(modeStr.toUpperCase(Locale.US)); } catch (IllegalArgumentException e) { NoSuchAlgorithmException newE = new NoSuchAlgorithmException("No such mode: " + modeStr); newE.initCause(e); throw newE; } checkSupportedMode(mode); this.mode = mode; }
@Override protected void engineSetMode(String modeStr) throws NoSuchAlgorithmException { final Mode mode; try { mode = Mode.valueOf(modeStr.toUpperCase(Locale.US)); } catch (IllegalArgumentException e) { NoSuchAlgorithmException newE = new NoSuchAlgorithmException("No such mode: " + modeStr); newE.initCause(e); throw newE; } checkSupportedMode(mode); this.mode = mode; }
@Override protected void engineSetMode(String modeStr) throws NoSuchAlgorithmException { final Mode mode; try { mode = Mode.valueOf(modeStr.toUpperCase(Locale.US)); } catch (IllegalArgumentException e) { NoSuchAlgorithmException newE = new NoSuchAlgorithmException("No such mode: " + modeStr); newE.initCause(e); throw newE; } checkSupportedMode(mode); this.mode = mode; }
public SignedContent getSignedContent(File content) throws IOException, InvalidKeyException, SignatureException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException { if (content == null) throw new IllegalArgumentException("null content"); //$NON-NLS-1$ BundleFile contentBundleFile; if (content.isDirectory()) contentBundleFile = new DirBundleFile(content); else contentBundleFile = new ZipBundleFile(content, null); SignedBundleFile result = new SignedBundleFile(null, VERIFY_ALL); try { result.setBundleFile(contentBundleFile); } catch (InvalidKeyException e) { throw (InvalidKeyException) new InvalidKeyException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } catch (SignatureException e) { throw (SignatureException) new SignatureException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } catch (CertificateException e) { throw (CertificateException) new CertificateException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } catch (NoSuchAlgorithmException e) { throw (NoSuchAlgorithmException) new NoSuchAlgorithmException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } catch (NoSuchProviderException e) { throw (NoSuchProviderException) new NoSuchProviderException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } return new SignedContentFile(result.getSignedContent()); }
public SignedContent getSignedContent(File content) throws IOException, InvalidKeyException, SignatureException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException { if (content == null) throw new IllegalArgumentException("null content"); //$NON-NLS-1$ BundleFile contentBundleFile; if (content.isDirectory()) contentBundleFile = new DirBundleFile(content); else contentBundleFile = new ZipBundleFile(content, null); SignedBundleFile result = new SignedBundleFile(null, VERIFY_ALL); try { result.setBundleFile(contentBundleFile); } catch (InvalidKeyException e) { throw (InvalidKeyException) new InvalidKeyException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } catch (SignatureException e) { throw (SignatureException) new SignatureException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } catch (CertificateException e) { throw (CertificateException) new CertificateException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } catch (NoSuchAlgorithmException e) { throw (NoSuchAlgorithmException) new NoSuchAlgorithmException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } catch (NoSuchProviderException e) { throw (NoSuchProviderException) new NoSuchProviderException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } return new SignedContentFile(result.getSignedContent()); }
public SignedContent getSignedContent(File content) throws IOException, InvalidKeyException, SignatureException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException { if (content == null) throw new IllegalArgumentException("null content"); //$NON-NLS-1$ BundleFile contentBundleFile; if (content.isDirectory()) { contentBundleFile = new DirBundleFile(content, false); } else { // make sure we have a ZipFile first, this will throw an IOException if not valid ZipFile temp = new ZipFile(content); temp.close(); contentBundleFile = new ZipBundleFile(content, null, null, container.getConfiguration().getDebug()); } SignedBundleFile result = new SignedBundleFile(contentBundleFile, null, VERIFY_ALL, this); try { result.initializeSignedContent(); } catch (InvalidKeyException e) { throw (InvalidKeyException) new InvalidKeyException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } catch (SignatureException e) { throw (SignatureException) new SignatureException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } catch (CertificateException e) { throw (CertificateException) new CertificateException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } catch (NoSuchAlgorithmException e) { throw (NoSuchAlgorithmException) new NoSuchAlgorithmException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } catch (NoSuchProviderException e) { throw (NoSuchProviderException) new NoSuchProviderException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } return new SignedContentFile(result.getSignedContent()); }
public SignedContent getSignedContent(File content) throws IOException, InvalidKeyException, SignatureException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException { if (content == null) throw new IllegalArgumentException("null content"); //$NON-NLS-1$ BundleFile contentBundleFile; if (content.isDirectory()) { contentBundleFile = new DirBundleFile(content, false); } else { // make sure we have a ZipFile first, this will throw an IOException if not valid ZipFile temp = new ZipFile(content); temp.close(); contentBundleFile = new ZipBundleFile(content, null, null, container.getConfiguration().getDebug()); } SignedBundleFile result = new SignedBundleFile(contentBundleFile, null, VERIFY_ALL, this); try { result.initializeSignedContent(); } catch (InvalidKeyException e) { throw (InvalidKeyException) new InvalidKeyException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } catch (SignatureException e) { throw (SignatureException) new SignatureException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } catch (CertificateException e) { throw (CertificateException) new CertificateException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } catch (NoSuchAlgorithmException e) { throw (NoSuchAlgorithmException) new NoSuchAlgorithmException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } catch (NoSuchProviderException e) { throw (NoSuchProviderException) new NoSuchProviderException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } return new SignedContentFile(result.getSignedContent()); }
public SignedContent getSignedContent(File content) throws IOException, InvalidKeyException, SignatureException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException { if (content == null) throw new IllegalArgumentException("null content"); //$NON-NLS-1$ BundleFile contentBundleFile; if (content.isDirectory()) { contentBundleFile = new DirBundleFile(content, false); } else { // Make sure we have a ZipFile first, this will throw an IOException if not valid. // Use SecureAction because it gives better errors about the path on exceptions ZipFile temp = secureAction.getZipFile(content); temp.close(); contentBundleFile = new ZipBundleFile(content, null, null, container.getConfiguration().getDebug()); } SignedBundleFile result = new SignedBundleFile(contentBundleFile, null, VERIFY_ALL, this); try { result.initializeSignedContent(); } catch (InvalidKeyException e) { throw (InvalidKeyException) new InvalidKeyException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } catch (SignatureException e) { throw (SignatureException) new SignatureException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } catch (CertificateException e) { throw (CertificateException) new CertificateException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } catch (NoSuchAlgorithmException e) { throw (NoSuchAlgorithmException) new NoSuchAlgorithmException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } catch (NoSuchProviderException e) { throw (NoSuchProviderException) new NoSuchProviderException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } return new SignedContentFile(result.getSignedContent()); }
public SignedContent getSignedContent(File content) throws IOException, InvalidKeyException, SignatureException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException { if (content == null) throw new IllegalArgumentException("null content"); //$NON-NLS-1$ BundleFile contentBundleFile; if (content.isDirectory()) { contentBundleFile = new DirBundleFile(content, false); } else { // Make sure we have a ZipFile first, this will throw an IOException if not valid. // Use SecureAction because it gives better errors about the path on exceptions ZipFile temp = secureAction.getZipFile(content); temp.close(); contentBundleFile = new ZipBundleFile(content, null, null, container.getConfiguration().getDebug()); } SignedBundleFile result = new SignedBundleFile(contentBundleFile, null, VERIFY_ALL, this); try { result.initializeSignedContent(); } catch (InvalidKeyException e) { throw (InvalidKeyException) new InvalidKeyException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } catch (SignatureException e) { throw (SignatureException) new SignatureException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } catch (CertificateException e) { throw (CertificateException) new CertificateException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } catch (NoSuchAlgorithmException e) { throw (NoSuchAlgorithmException) new NoSuchAlgorithmException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } catch (NoSuchProviderException e) { throw (NoSuchProviderException) new NoSuchProviderException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e); } return new SignedContentFile(result.getSignedContent()); }