Class PqcTransportConfig

java.lang.Object
co.ankatech.ankasecure.sdk.transport.PqcTransportConfig

public final class PqcTransportConfig extends Object
Configuration holder for PQC transport encryption settings.
  • Field Details

  • Constructor Details

    • PqcTransportConfig

      public PqcTransportConfig(Properties props)
      Reads PQC transport settings from provided CLI properties.

      When the transport is enabled, "pqc.kem.algorithm" must name one of supportedKemAlgorithms(); it is resolved here, so a misconfigured KEM is refused when the client is built rather than at the first request.

      Parameters:
      props - CLI properties containing pqc.* keys
      Throws:
      InvalidInputException - when the transport is enabled and the configured KEM is not supported
  • Method Details

    • resolveKemAlgorithm

      public static String resolveKemAlgorithm(String configured)
      Resolves a "pqc.kem.algorithm" value to the catalogue name of the KEM it names.
      Parameters:
      configured - the configured value, case-insensitive; null means the default
      Returns:
      the catalogue name (e.g. "HQC-128" for "hqc-128")
      Throws:
      InvalidInputException - when the value is not one of supportedKemAlgorithms()
    • supportedKemAlgorithms

      public static List<String> supportedKemAlgorithms()
      Returns:
      the catalogue names of the KEMs "pqc.kem.algorithm" accepts
    • getKemAlgorithm

      public String getKemAlgorithm()
      Returns:
      the KEM the handshake uses: its catalogue name when the transport is enabled, the configured value as written otherwise
    • isEnabled

      public boolean isEnabled()
      Returns:
      true if PQC transport encryption is enabled
    • getSessionTtl

      public Duration getSessionTtl()
      Returns:
      session time-to-live duration