/** * Get a provider given it's name. * * @param providerName * provider name * @return provider * @throws IllegalArgumentException * if no such provider is found */ public static SshProvider getProviderByName(String providerName) { SshProvider[] providers = getAllProviders(); for (int i = 0; i < providers.length; i++) { if (providers[i].getName().equals(providerName)) { return providers[i]; } } throw new IllegalArgumentException("No provider named " + providerName); }
/** * Get a provider given it's name. * * @param providerName * provider name * @return provider * @throws IllegalArgumentException * if no such provider is found */ public static SshProvider getProviderByName(String providerName) { SshProvider[] providers = getAllProviders(); for (int i = 0; i < providers.length; i++) { if (providers[i].getName().equals(providerName)) { return providers[i]; } } throw new IllegalArgumentException("No provider named " + providerName); }
/** * Get all discovered {@link Capability}. This is determine by examining all * providers for their capabilities and producing a unique list. * * @return all capabilities */ public static Capability[] getAllCapabilties() { List capabilties = new ArrayList(); SshProvider[] providers = getAllProviders(); for (int i = 0; i < providers.length; i++) { List c = providers[i].getCapabilities(); for (Iterator it = c.iterator(); it.hasNext();) { Capability cap = (Capability) it.next(); if (!capabilties.contains(cap)) { capabilties.add(cap); } } } return (Capability[]) capabilties.toArray(new Capability[0]); }
/** * Get all discovered {@link Capability}. This is determine by examining all * providers for their capabilities and producing a unique list. * * @return all capabilities */ public static Capability[] getAllCapabilties() { List capabilties = new ArrayList(); SshProvider[] providers = getAllProviders(); for (int i = 0; i < providers.length; i++) { List c = providers[i].getCapabilities(); for (Iterator it = c.iterator(); it.hasNext();) { Capability cap = (Capability) it.next(); if (!capabilties.contains(cap)) { capabilties.add(cap); } } } return (Capability[]) capabilties.toArray(new Capability[0]); }
/** * Get all discovered compression algorithms. This is determine by examining * all providers for their algorithms and producing a unique list. * * @return all compression algorithms */ public static String[] getAllCompression() { List comp = new ArrayList(); SshProvider[] providers = getAllProviders(); for (int i = 0; i < providers.length; i++) { try { List c = providers[i].getSupportedCompression(); addList(comp, c); } catch (UnsatisfiedLinkError ule) { System.out .println("WARNING: Provider requires a native library but it could not be found." + ule.getMessage()); } catch (Exception ex) { System.out.println("WARNING: Provider failed to load. " + ex.getMessage()); ex.printStackTrace(); } } return (String[]) comp.toArray(new String[0]); }
/** * Get all discovered public key algorithms. This is determine by examining * all providers for their algorithms and producing a unique list. * * @return all public key algorithms */ public static String[] getAllPublicKey() { List pk = new ArrayList(); SshProvider[] providers = getAllProviders(); for (int i = 0; i < providers.length; i++) { try { List c = providers[i].getSupportedPublicKey(); addList(pk, c); } catch (UnsatisfiedLinkError ule) { System.out .println("WARNING: Provider requires a native library but it could not be found." + ule.getMessage()); } catch (Exception ex) { System.out.println("WARNING: Provider failed to load. " + ex.getMessage()); ex.printStackTrace(); } } return (String[]) pk.toArray(new String[0]); }
/** * Get all discovered message authentication code algorithms. This is * determine by examining all providers for their algorithms and producing a * unique list. * * @return all message authentication code algorithms */ public static String[] getAllMAC() { List mac = new ArrayList(); SshProvider[] providers = getAllProviders(); for (int i = 0; i < providers.length; i++) { try { List c = providers[i].getSupportedMAC(); addList(mac, c); } catch (UnsatisfiedLinkError ule) { System.out .println("WARNING: Provider requires a native library but it could not be found." + ule.getMessage()); } catch (Exception ex) { System.out.println("WARNING: Provider failed to load. " + ex.getMessage()); ex.printStackTrace(); } } return (String[]) mac.toArray(new String[0]); }
/** * Get all discovered public key algorithms. This is determine by examining * all providers for their algorithms and producing a unique list. * * @return all public key algorithms */ public static String[] getAllPublicKey() { List pk = new ArrayList(); SshProvider[] providers = getAllProviders(); for (int i = 0; i < providers.length; i++) { try { List c = providers[i].getSupportedPublicKey(); addList(pk, c); } catch (UnsatisfiedLinkError ule) { System.out .println("WARNING: Provider requires a native library but it could not be found." + ule.getMessage()); } catch (Exception ex) { System.out.println("WARNING: Provider failed to load. " + ex.getMessage()); ex.printStackTrace(); } } return (String[]) pk.toArray(new String[0]); }
/** * Get all discovered ciphers. This is determine by examining all providers * for their ciphers and producing a unique list. * * @return all ciphers */ public static String[] getAllCiphers() { List ciphers = new ArrayList(); SshProvider[] providers = getAllProviders(); for (int i = 0; i < providers.length; i++) { try { List c = providers[i] .getSupportedCiphers(SshConfiguration.SSH1_OR_SSH2); addList(ciphers, c); } catch (UnsatisfiedLinkError ule) { System.out .println("WARNING: Provider requires a native library but it could not be found." + ule.getMessage()); } catch (Exception ex) { System.out.println("WARNING: Provider failed to load. " + ex.getMessage()); ex.printStackTrace(); } } return (String[]) ciphers.toArray(new String[0]); }
/** * Get all discovered ciphers. This is determine by examining all providers * for their ciphers and producing a unique list. * * @return all ciphers */ public static String[] getAllCiphers() { List ciphers = new ArrayList(); SshProvider[] providers = getAllProviders(); for (int i = 0; i < providers.length; i++) { try { List c = providers[i] .getSupportedCiphers(SshConfiguration.SSH1_OR_SSH2); addList(ciphers, c); } catch (UnsatisfiedLinkError ule) { System.out .println("WARNING: Provider requires a native library but it could not be found." + ule.getMessage()); } catch (Exception ex) { System.out.println("WARNING: Provider failed to load. " + ex.getMessage()); ex.printStackTrace(); } } return (String[]) ciphers.toArray(new String[0]); }
/** * Get all discovered message authentication code algorithms. This is * determine by examining all providers for their algorithms and producing a * unique list. * * @return all message authentication code algorithms */ public static String[] getAllMAC() { List mac = new ArrayList(); SshProvider[] providers = getAllProviders(); for (int i = 0; i < providers.length; i++) { try { List c = providers[i].getSupportedMAC(); addList(mac, c); } catch (UnsatisfiedLinkError ule) { System.out .println("WARNING: Provider requires a native library but it could not be found." + ule.getMessage()); } catch (Exception ex) { System.out.println("WARNING: Provider failed to load. " + ex.getMessage()); ex.printStackTrace(); } } return (String[]) mac.toArray(new String[0]); }
/** * Get all discovered key exchange algorithms. This is determine by * examining all providers for their algorithms and producing a unique list. * * @return all key exchange algorithms */ public static String[] getAllKEX() { List kex = new ArrayList(); SshProvider[] providers = getAllProviders(); for (int i = 0; i < providers.length; i++) { try { List c = providers[i].getSupportedKeyExchange(); addList(kex, c); } catch (UnsatisfiedLinkError ule) { System.out .println("WARNING: Provider requires a native library but it could not be found." + ule.getMessage()); } catch (Exception ex) { System.out.println("WARNING: Provider failed to load. " + ex.getMessage()); ex.printStackTrace(); } } return (String[]) kex.toArray(new String[0]); }
/** * Get all discovered compression algorithms. This is determine by examining * all providers for their algorithms and producing a unique list. * * @return all compression algorithms */ public static String[] getAllCompression() { List comp = new ArrayList(); SshProvider[] providers = getAllProviders(); for (int i = 0; i < providers.length; i++) { try { List c = providers[i].getSupportedCompression(); addList(comp, c); } catch (UnsatisfiedLinkError ule) { System.out .println("WARNING: Provider requires a native library but it could not be found." + ule.getMessage()); } catch (Exception ex) { System.out.println("WARNING: Provider failed to load. " + ex.getMessage()); ex.printStackTrace(); } } return (String[]) comp.toArray(new String[0]); }
/** * Get all discovered key exchange algorithms. This is determine by * examining all providers for their algorithms and producing a unique list. * * @return all key exchange algorithms */ public static String[] getAllKEX() { List kex = new ArrayList(); SshProvider[] providers = getAllProviders(); for (int i = 0; i < providers.length; i++) { try { List c = providers[i].getSupportedKeyExchange(); addList(kex, c); } catch (UnsatisfiedLinkError ule) { System.out .println("WARNING: Provider requires a native library but it could not be found." + ule.getMessage()); } catch (Exception ex) { System.out.println("WARNING: Provider failed to load. " + ex.getMessage()); ex.printStackTrace(); } } return (String[]) kex.toArray(new String[0]); }
SshProvider[] providers = DefaultProviderFactory.getAllProviders(); System.out.println("Providers :-"); for (int i = 0; i < providers.length; i++) {
static String getHTML() throws Exception { SshProvider[] providers = DefaultProviderFactory.getAllProviders(); Capability[] caps = DefaultProviderFactory.getAllCapabilties(); String[] ciphers = DefaultProviderFactory.getAllCiphers();
SshProvider[] providers = DefaultProviderFactory.getAllProviders(); Capability[] caps = DefaultProviderFactory.getAllCapabilties(); String[] ciphers = DefaultProviderFactory.getAllCiphers();