/** * @param dhList A comma-separated list of ciphers' names - ignored * if {@code null}/empty * @return A {@link ParseResult} of all the {@link DHFactory}-ies whose * name appears in the string and represent a built-in value. Any * unknown name is <U>ignored</U>. The order of the returned result * is the same as the original order - bar the unknown ones. * <B>Note:</B> it is up to caller to ensure that the list does not * contain duplicates */ public static ParseResult parseDHFactoriesList(String dhList) { return parseDHFactoriesList(GenericUtils.split(dhList, ',')); }
/** * @param dhList A comma-separated list of ciphers' names - ignored * if {@code null}/empty * @return A {@link ParseResult} of all the {@link DHFactory}-ies whose * name appears in the string and represent a built-in value. Any * unknown name is <U>ignored</U>. The order of the returned result * is the same as the original order - bar the unknown ones. * <B>Note:</B> it is up to caller to ensure that the list does not * contain duplicates */ public static ParseResult parseDHFactoriesList(String dhList) { return parseDHFactoriesList(GenericUtils.split(dhList, ',')); }
/** * @param props The {@link PropertyResolver} - ignored if {@code null}/empty * @return A {@code ParseResult} of all the {@link DHFactory}-ies * whose name appears in the string and represent a built-in value. Any * unknown name is <U>ignored</U>. The order of the returned result is the * same as the original order - bar the unknown ones. <B>Note:</B> it is * up to caller to ensure that the list does not contain duplicates * @see ConfigFileReaderSupport#KEX_ALGORITHMS_CONFIG_PROP KEX_ALGORITHMS_CONFIG_PROP * @see BuiltinDHFactories#parseDHFactoriesList(String) */ public static BuiltinDHFactories.ParseResult getKexFactories(PropertyResolver props) { return BuiltinDHFactories.parseDHFactoriesList( (props == null) ? null : props.getString(ConfigFileReaderSupport.KEX_ALGORITHMS_CONFIG_PROP)); }
public static ParseResult parseDHFactoriesList(String... dhList) { return parseDHFactoriesList(GenericUtils.isEmpty((Object[]) dhList) ? Collections.emptyList() : Arrays.asList(dhList)); }
/** * @param props The {@link PropertyResolver} - ignored if {@code null}/empty * @return A {@code ParseResult} of all the {@link DHFactory}-ies * whose name appears in the string and represent a built-in value. Any * unknown name is <U>ignored</U>. The order of the returned result is the * same as the original order - bar the unknown ones. <B>Note:</B> it is * up to caller to ensure that the list does not contain duplicates * @see ConfigFileReaderSupport#KEX_ALGORITHMS_CONFIG_PROP KEX_ALGORITHMS_CONFIG_PROP * @see BuiltinDHFactories#parseDHFactoriesList(String) */ public static BuiltinDHFactories.ParseResult getKexFactories(PropertyResolver props) { return BuiltinDHFactories.parseDHFactoriesList( (props == null) ? null : props.getString(ConfigFileReaderSupport.KEX_ALGORITHMS_CONFIG_PROP)); }
public static ParseResult parseDHFactoriesList(String... dhList) { return parseDHFactoriesList(GenericUtils.isEmpty((Object[]) dhList) ? Collections.emptyList() : Arrays.asList(dhList)); }
public static <M extends AbstractFactoryManager> M configureKeyExchanges( M manager, String value, boolean lenient, Function<? super DHFactory, ? extends NamedFactory<KeyExchange>> xformer, boolean ignoreUnsupported) { Objects.requireNonNull(manager, "No manager to configure"); Objects.requireNonNull(xformer, "No DHFactory transformer"); BuiltinDHFactories.ParseResult result = BuiltinDHFactories.parseDHFactoriesList(value); Collection<String> unsupported = result.getUnsupportedFactories(); ValidateUtils.checkTrue(lenient || GenericUtils.isEmpty(unsupported), "Unsupported KEX(s) (%s) in %s", unsupported, value); List<NamedFactory<KeyExchange>> factories = NamedFactory.setUpTransformedFactories(ignoreUnsupported, result.getParsedFactories(), xformer); manager.setKeyExchangeFactories(ValidateUtils.checkNotNullAndNotEmpty(factories, "No known/supported KEXS(s): %s", value)); return manager; }
public static <M extends AbstractFactoryManager> M configureKeyExchanges( M manager, String value, boolean lenient, Function<? super DHFactory, ? extends NamedFactory<KeyExchange>> xformer, boolean ignoreUnsupported) { Objects.requireNonNull(manager, "No manager to configure"); Objects.requireNonNull(xformer, "No DHFactory transformer"); BuiltinDHFactories.ParseResult result = BuiltinDHFactories.parseDHFactoriesList(value); Collection<String> unsupported = result.getUnsupportedFactories(); ValidateUtils.checkTrue(lenient || GenericUtils.isEmpty(unsupported), "Unsupported KEX(s) (%s) in %s", unsupported, value); List<NamedFactory<KeyExchange>> factories = NamedFactory.setUpTransformedFactories(ignoreUnsupported, result.getParsedFactories(), xformer); manager.setKeyExchangeFactories(ValidateUtils.checkNotNullAndNotEmpty(factories, "No known/supported KEXS(s): %s", value)); return manager; }