Class AlgorithmPair

java.lang.Object
co.ankatech.ankasecure.sdk.model.AlgorithmPair

public final class AlgorithmPair extends Object
Immutable pair of classical and post-quantum algorithm identifiers.

Used for composite key recommendations and compatibility validation. This class represents a valid combination of a classical algorithm (e.g., X25519, RSA-3072) with a PQC algorithm (e.g., ML-KEM-768, ML-DSA-65).

Example Usage:


 AlgorithmPair pair = new AlgorithmPair("X25519", "ML-KEM-768");
 System.out.println(pair.getClassicalAlgorithm()); // X25519
 System.out.println(pair.getPqcAlgorithm());       // ML-KEM-768
 System.out.println(pair);                          // X25519 + ML-KEM-768
 
Since:
3.0.0
See Also:
  • Constructor Details

    • AlgorithmPair

      public AlgorithmPair(String classicalAlgorithm, String pqcAlgorithm)
      Creates a new algorithm pair.
      Parameters:
      classicalAlgorithm - the classical algorithm API value (e.g., "X25519", "RSA-3072")
      pqcAlgorithm - the PQC algorithm API value (e.g., "ML-KEM-768", "ML-DSA-65")
      Throws:
      NullPointerException - if either parameter is null
  • Method Details

    • getClassicalAlgorithm

      public String getClassicalAlgorithm()
      Returns the classical algorithm in this pair.
      Returns:
      the classical algorithm API value (e.g., "X25519", "RSA-3072", "Ed25519")
    • getPqcAlgorithm

      public String getPqcAlgorithm()
      Returns the PQC algorithm in this pair.
      Returns:
      the PQC algorithm API value (e.g., "ML-KEM-768", "ML-DSA-65")
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object