OpenSSLCipherConfigurationParser (Apache Tomcat 10.1.57 API Documentation)
Description: declaration: package: org.apache.tomcat.util.net.openssl.ciphers, class: OpenSSLCipherConfigurationParser

# Class OpenSSLCipherConfigurationParser

java.lang.Object
org.apache.tomcat.util.net.openssl.ciphers.OpenSSLCipherConfigurationParser

public class OpenSSLCipherConfigurationParser extends Object
Class in charge with parsing openSSL expressions to define a list of ciphers.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `OpenSSLCipherConfigurationParser()`
  Constructs an OpenSSLCipherConfigurationParser.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static List<String>`
  `convertForJSSE(Collection<Cipher> ciphers)`
  Converts a collection of OpenSSL ciphers to their JSSE names.
  `static boolean`
  `isTls13Cipher(String cipherSuiteName)`
  Determines if the provided name is the name of a TLS 1.3 cipher suite.
  `static String`
  `jsseToOpenSSL(String jsseCipherName)`
  Converts a JSSE cipher name to an OpenSSL cipher name.
  `static void`
  `main(String[] args)`
  Main entry point for the cipher configuration parser tool.
  `static String`
  `openSSLToJsse(String opensslCipherName)`
  Converts an OpenSSL cipher name to a JSSE cipher name.
  `static LinkedHashSet<Cipher>`
  `parse(String expression)`
  Parses an OpenSSL cipher expression into a set of ciphers.
  `static List<String>`
  `parseExpression(String expression)`
  Parse the specified expression according to the OpenSSL syntax and returns a list of standard JSSE cipher names.
  `static void`
  `usage()`
  Prints usage information for the command-line tool.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### OpenSSLCipherConfigurationParser

    public OpenSSLCipherConfigurationParser()
    Constructs an OpenSSLCipherConfigurationParser.

- ## Method Details

  - ### parse

    public static LinkedHashSet<Cipher> parse(String expression)
    Parses an OpenSSL cipher expression into a set of ciphers.
    Parameters:
      `expression` - The cipher expression to parse
    Returns:
      The set of matching ciphers

  - ### convertForJSSE

    public static List<String> convertForJSSE(Collection<Cipher> ciphers)
    Converts a collection of OpenSSL ciphers to their JSSE names.
    Parameters:
      `ciphers` - The OpenSSL ciphers to convert
    Returns:
      The list of JSSE cipher names

  - ### isTls13Cipher

    public static boolean isTls13Cipher(String cipherSuiteName)
    Determines if the provided name is the name of a TLS 1.3 cipher suite.
    Parameters:
      `cipherSuiteName` - The name to test
    Returns:
      `true` if the provided String is recognised as the name of a TLS 1.3 cipherSuite.

  - ### parseExpression

    public static List<String> parseExpression(String expression)
    Parse the specified expression according to the OpenSSL syntax and returns a list of standard JSSE cipher names.
    Parameters:
      `expression` - the openssl expression to define a list of cipher.
    Returns:
      the corresponding list of ciphers.

  - ### jsseToOpenSSL

    public static String jsseToOpenSSL(String jsseCipherName)
    Converts a JSSE cipher name to an OpenSSL cipher name.
    Parameters:
      `jsseCipherName` - The JSSE name for a cipher
    Returns:
      The OpenSSL name for the specified JSSE cipher

  - ### openSSLToJsse

    public static String openSSLToJsse(String opensslCipherName)
    Converts an OpenSSL cipher name to a JSSE cipher name.
    Parameters:
      `opensslCipherName` - The OpenSSL name for a cipher
    Returns:
      The JSSE name for the specified OpenSSL cipher. If none is known, the IANA standard name will be returned instead

  - ### usage

    public static void usage()
    Prints usage information for the command-line tool.

  - ### main

    public static void main(String[] args) throws Exception
    Main entry point for the cipher configuration parser tool.
    Parameters:
      `args` - Command line arguments
    Throws:
      `Exception` - if an error occurs