@Test public void testInvalidFormatCipherSuites() { try { CipherSuiteSelector.fromNamesString("TLS_CHACHA20_POLY1305_SHA256 !TLS_AES_128_CCM_8_SHA256"); fail("Expected IllegalArgumentException not thrown"); } catch (IllegalArgumentException expected) { } }
public static CipherSuiteSelector fromNamesString(String names) throws IllegalArgumentException { final CodePointIterator cpi = CodePointIterator.ofString(names); final CodePointIterator di = cpi.delimitedBy(':'); CipherSuiteSelector current = empty(true); while (cpi.hasNext()) { if (di.hasNext()) { String name = di.drainToString(); final MechanismDatabase database = MechanismDatabase.getTLS13Instance(); MechanismDatabase.Entry entry = database.getCipherSuiteOpenSSLName(name); if (entry == null) { throw ElytronMessages.log.unknownCipherSuiteName(name, names); } current = current.add(name); } else { cpi.next(); } } return current; }
CipherSuiteSelector { public static CipherSuiteSelector fromNamesString(String names) throws IllegalArgumentException { final CodePointIterator cpi = CodePointIterator.ofString(names); final CodePointIterator di = cpi.delimitedBy(':'); CipherSuiteSelector current = empty(true); while (cpi.hasNext()) { if (di.hasNext()) { String name = di.drainToString(); final MechanismDatabase database = MechanismDatabase.getTLS13Instance(); MechanismDatabase.Entry entry = database.getCipherSuiteOpenSSLName(name); if (entry == null) { throw ElytronMessages.log.unknownCipherSuiteName(name, names); } current = current.add(name); } else { cpi.next(); } } return current; } }
CipherSuiteSelector { public static CipherSuiteSelector fromNamesString(String names) throws IllegalArgumentException { final CodePointIterator cpi = CodePointIterator.ofString(names); final CodePointIterator di = cpi.delimitedBy(':'); CipherSuiteSelector current = empty(true); while (cpi.hasNext()) { if (di.hasNext()) { String name = di.drainToString(); final MechanismDatabase database = MechanismDatabase.getTLS13Instance(); MechanismDatabase.Entry entry = database.getCipherSuiteOpenSSLName(name); if (entry == null) { throw ElytronMessages.log.unknownCipherSuiteName(name, names); } current = current.add(name); } else { cpi.next(); } } return current; } CipherSuiteSelector(final CipherSuiteSelector prev); }
CipherSuiteSelector { public static CipherSuiteSelector fromNamesString(String names) throws IllegalArgumentException { final CodePointIterator cpi = CodePointIterator.ofString(names); final CodePointIterator di = cpi.delimitedBy(':'); CipherSuiteSelector current = empty(true); while (cpi.hasNext()) { if (di.hasNext()) { String name = di.drainToString(); final MechanismDatabase database = MechanismDatabase.getTLS13Instance(); MechanismDatabase.Entry entry = database.getCipherSuiteOpenSSLName(name); if (entry == null) { throw ElytronMessages.log.unknownCipherSuiteName(name, names); } current = current.add(name); } else { cpi.next(); } } 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 fromNamesString(String names) throws IllegalArgumentException { final CodePointIterator cpi = CodePointIterator.ofString(names); final CodePointIterator di = cpi.delimitedBy(':'); CipherSuiteSelector current = empty(true); while (cpi.hasNext()) { if (di.hasNext()) { String name = di.drainToString(); final MechanismDatabase database = MechanismDatabase.getTLS13Instance(); MechanismDatabase.Entry entry = database.getCipherSuiteOpenSSLName(name); if (entry == null) { throw ElytronMessages.log.unknownCipherSuiteName(name, names); } current = current.add(name); } else { cpi.next(); } } 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; }