@Test(expected = IllegalArgumentException.class) public void testMinusBetweenRsaAes() { CipherSuiteSelector.fromString("RSA-AES"); }
public static CipherSuiteSelector fromString(String string) throws IllegalArgumentException { final CodePointIterator i = CodePointIterator.ofString(string); CipherSuiteSelector current = empty(); CipherSuitePredicate predicate; String name; int cp; while (i.hasNext()) { cp = i.next(); switch (cp) { case '+': { current = parseMoveToEnd(current, i); break; } case '-': { current = parseRemove(current, i); break; } case '!': { current = parseDelete(current, i); break; } case '@': { current = parseSpecial(current, i); break; } case '=': { throw ElytronMessages.log.mechSelectorTokenNotAllowed("=", i.getIndex(), string); } case ',': case ':': { break; } default: { if (Character.isWhitespace(cp)) { break; } if (Character.isLetterOrDigit(cp)) { i.previous(); name = i.delimitedBy('+', ':', ',', ' ').drainToString(); predicate = parsePredicate(i, name); if (predicate != null) { current = current.add(predicate); } else { switch (name) { case "DEFAULT": current = current.add(CipherSuitePredicate.matchOpenSslAll()) .deleteFully(CipherSuitePredicate.matchOpenSslDefaultDeletes()); break; case "COMPLEMENTOFDEFAULT": current = current.add(CipherSuitePredicate.matchAnonDH()); break; case "ALL": current = current.add(CipherSuitePredicate.matchOpenSslAll()); break; case "COMPLEMENTOFALL": current = current.add(CipherSuitePredicate.matchOpenSslComplementOfAll()); break; default: { throw ElytronMessages.log.mechSelectorUnknownToken(name, string); } } } break; } throw ElytronMessages.log.mechSelectorUnexpectedChar(cp, i.getIndex(), string); } } } return current; }
CipherSuiteSelector { public static CipherSuiteSelector fromString(String string) throws IllegalArgumentException { final CodePointIterator i = CodePointIterator.ofString(string); CipherSuiteSelector current = empty(); CipherSuitePredicate predicate; String name; int cp; while (i.hasNext()) { cp = i.next(); switch (cp) { case '+': { current = parseMoveToEnd(current, i); break; } case '-': { current = parseRemove(current, i); break; } case '!': { current = parseDelete(current, i); break; } case '@': { current = parseSpecial(current, i); break; } case '=': { throw ElytronMessages.log.mechSelectorTokenNotAllowed("=", i.getIndex(), string); } case ',': case ':': { break; } default: { if (Character.isWhitespace(cp)) { break; } if (Character.isLetterOrDigit(cp)) { i.previous(); name = i.delimitedBy('+', ':', ',', ' ').drainToString(); predicate = parsePredicate(i, name); if (predicate != null) { current = current.add(predicate); } else { switch (name) { case "DEFAULT": current = current.add(CipherSuitePredicate.matchOpenSslAll()) .deleteFully(CipherSuitePredicate.matchOpenSslDefaultDeletes()); break; case "COMPLEMENTOFDEFAULT": current = current.add(CipherSuitePredicate.matchAnonDH()); break; case "ALL": current = current.add(CipherSuitePredicate.matchOpenSslAll()); break; case "COMPLEMENTOFALL": current = current.add(CipherSuitePredicate.matchOpenSslComplementOfAll()); break; default: { throw ElytronMessages.log.mechSelectorUnknownToken(name, string); } } } break; } throw ElytronMessages.log.mechSelectorUnexpectedChar(cp, i.getIndex(), string); } } } return current; } }
CipherSuiteSelector { public static CipherSuiteSelector fromString(String string) throws IllegalArgumentException { final CodePointIterator i = CodePointIterator.ofString(string); CipherSuiteSelector current = empty(); CipherSuitePredicate predicate; String name; int cp; while (i.hasNext()) { cp = i.next(); switch (cp) { case '+': { current = parseMoveToEnd(current, i); break; } case '-': { current = parseRemove(current, i); break; } case '!': { current = parseDelete(current, i); break; } case '@': { current = parseSpecial(current, i); break; } case '=': { throw ElytronMessages.log.mechSelectorTokenNotAllowed("=", i.getIndex(), string); } case ',': case ':': { break; } default: { if (Character.isWhitespace(cp)) { break; } if (Character.isLetterOrDigit(cp)) { i.previous(); name = i.delimitedBy('+', ':', ',', ' ').drainToString(); predicate = parsePredicate(i, name); if (predicate != null) { current = current.add(predicate); } else { switch (name) { case "DEFAULT": current = current.add(CipherSuitePredicate.matchOpenSslAll()) .deleteFully(CipherSuitePredicate.matchOpenSslDefaultDeletes()); break; case "COMPLEMENTOFDEFAULT": current = current.add(CipherSuitePredicate.matchAnonDH()); break; case "ALL": current = current.add(CipherSuitePredicate.matchOpenSslAll()); break; case "COMPLEMENTOFALL": current = current.add(CipherSuitePredicate.matchOpenSslComplementOfAll()); break; default: { throw ElytronMessages.log.mechSelectorUnknownToken(name, string); } } } break; } throw ElytronMessages.log.mechSelectorUnexpectedChar(cp, i.getIndex(), string); } } } return current; } CipherSuiteSelector(final CipherSuiteSelector prev); }
CipherSuiteSelector { public static CipherSuiteSelector fromString(String string) throws IllegalArgumentException { final CodePointIterator i = CodePointIterator.ofString(string); CipherSuiteSelector current = empty(); CipherSuitePredicate predicate; String name; int cp; while (i.hasNext()) { cp = i.next(); switch (cp) { case '+': { current = parseMoveToEnd(current, i); break; } case '-': { current = parseRemove(current, i); break; } case '!': { current = parseDelete(current, i); break; } case '@': { current = parseSpecial(current, i); break; } case '=': { throw ElytronMessages.log.mechSelectorTokenNotAllowed("=", i.getIndex(), string); } case ',': case ':': { break; } default: { if (Character.isWhitespace(cp)) { break; } if (Character.isLetterOrDigit(cp)) { i.previous(); name = i.delimitedBy('+', ':', ',', ' ').drainToString(); predicate = parsePredicate(i, name); if (predicate != null) { current = current.add(predicate); } else { switch (name) { case "DEFAULT": current = current.add(CipherSuitePredicate.matchOpenSslAll()) .deleteFully(CipherSuitePredicate.matchOpenSslDefaultDeletes()); break; case "COMPLEMENTOFDEFAULT": current = current.add(CipherSuitePredicate.matchAnonDH()); break; case "ALL": current = current.add(CipherSuitePredicate.matchOpenSslAll()); break; case "COMPLEMENTOFALL": current = current.add(CipherSuitePredicate.matchOpenSslComplementOfAll()); break; default: { throw ElytronMessages.log.mechSelectorUnknownToken(name, string); } } } break; } throw ElytronMessages.log.mechSelectorUnexpectedChar(cp, i.getIndex(), string); } } } return current; } CipherSuiteSelector(final CipherSuiteSelector prev); static CipherSuiteSelector empty(); static CipherSuiteSelector empty(final boolean useTLS13); static CipherSuiteSelector openSslDefault(); static CipherSuiteSelector openSslAll(); static CipherSuiteSelector openSslDefaultCipherSuites(); static CipherSuiteSelector openSslCombinedDefault(); CipherSuiteSelector deleteFully(final CipherSuitePredicate predicate); CipherSuiteSelector deleteFully(final String cipherSuiteName); CipherSuiteSelector remove(final CipherSuitePredicate predicate); CipherSuiteSelector remove(final String cipherSuiteName); CipherSuiteSelector add(final CipherSuitePredicate predicate); CipherSuiteSelector add(final String cipherSuiteName); CipherSuiteSelector pushToEnd(final CipherSuitePredicate predicate); CipherSuiteSelector pushToEnd(final String cipherSuiteName); CipherSuiteSelector sortByAlgorithmKeyLength(); final String toString(); String[] evaluate(String[] supportedMechanisms); static CipherSuiteSelector fromString(String string); static CipherSuiteSelector fromNamesString(String names); static CipherSuiteSelector aggregate(final CipherSuiteSelector cipherSuiteSelector1, final CipherSuiteSelector cipherSuiteSelector2); }
CipherSuiteSelector { public static CipherSuiteSelector fromString(String string) throws IllegalArgumentException { final CodePointIterator i = CodePointIterator.ofString(string); CipherSuiteSelector current = empty(); CipherSuitePredicate predicate; String name; int cp; while (i.hasNext()) { cp = i.next(); switch (cp) { case '+': { current = parseMoveToEnd(current, i); break; } case '-': { current = parseRemove(current, i); break; } case '!': { current = parseDelete(current, i); break; } case '@': { current = parseSpecial(current, i); break; } case '=': { throw ElytronMessages.log.mechSelectorTokenNotAllowed("=", i.getIndex(), string); } case ',': case ':': { break; } default: { if (Character.isWhitespace(cp)) { break; } if (Character.isLetterOrDigit(cp)) { i.previous(); name = i.delimitedBy('+', ':', ',', ' ').drainToString(); predicate = parsePredicate(i, name); if (predicate != null) { current = current.add(predicate); } else { switch (name) { case "DEFAULT": current = current.add(CipherSuitePredicate.matchOpenSslAll()) .deleteFully(CipherSuitePredicate.matchOpenSslDefaultDeletes()); break; case "COMPLEMENTOFDEFAULT": current = current.add(CipherSuitePredicate.matchAnonDH()); break; case "ALL": current = current.add(CipherSuitePredicate.matchOpenSslAll()); break; case "COMPLEMENTOFALL": current = current.add(CipherSuitePredicate.matchOpenSslComplementOfAll()); break; default: { throw ElytronMessages.log.mechSelectorUnknownToken(name, string); } } } break; } throw ElytronMessages.log.mechSelectorUnexpectedChar(cp, i.getIndex(), string); } } } return current; } CipherSuiteSelector(final CipherSuiteSelector prev); static CipherSuiteSelector empty(); static CipherSuiteSelector empty(final boolean useTLS13); static CipherSuiteSelector openSslDefault(); static CipherSuiteSelector openSslAll(); static CipherSuiteSelector openSslDefaultCipherSuites(); static CipherSuiteSelector openSslCombinedDefault(); CipherSuiteSelector deleteFully(final CipherSuitePredicate predicate); CipherSuiteSelector deleteFully(final String cipherSuiteName); CipherSuiteSelector remove(final CipherSuitePredicate predicate); CipherSuiteSelector remove(final String cipherSuiteName); CipherSuiteSelector add(final CipherSuitePredicate predicate); CipherSuiteSelector add(final String cipherSuiteName); CipherSuiteSelector pushToEnd(final CipherSuitePredicate predicate); CipherSuiteSelector pushToEnd(final String cipherSuiteName); CipherSuiteSelector sortByAlgorithmKeyLength(); final String toString(); String[] evaluate(String[] supportedMechanisms); static CipherSuiteSelector fromString(String string); static CipherSuiteSelector fromNamesString(String names); static CipherSuiteSelector aggregate(final CipherSuiteSelector cipherSuiteSelector1, final CipherSuiteSelector cipherSuiteSelector2); static final String OPENSSL_DEFAULT_CIPHER_SUITE_NAMES; }