Class LmsPublicKeySpec

java.lang.Object
zeroecho.core.alg.lms.LmsPublicKeySpec
All Implemented Interfaces:
AlgorithmKeySpec

public final class LmsPublicKeySpec extends Object implements AlgorithmKeySpec
Encoded representation of an LMS public key in X.509 (SubjectPublicKeyInfo) format.

LMS public keys are stateless and can be freely shared. The BCPQC provider encodes them as standard X.509 DER, compatible with KeyFactory.generatePublic(java.security.spec.KeySpec).

Since:
1.0
  • Constructor Details

    • LmsPublicKeySpec

      public LmsPublicKeySpec(byte[] x509Der)
      Constructs a new spec from X.509 DER encoded LMS public key bytes.
      Parameters:
      x509Der - X.509 DER bytes
      Throws:
      NullPointerException - if x509Der is null
  • Method Details

    • x509

      public byte[] x509()
      Returns a defensive copy of the X.509 encoded key bytes.
      Returns:
      X.509 DER bytes
    • marshal

      public static PairSeq marshal(LmsPublicKeySpec spec)
      Serializes this spec to a PairSeq.
      Parameters:
      spec - the spec to serialize
      Returns:
      serialized representation
    • unmarshal

      public static LmsPublicKeySpec unmarshal(PairSeq p)
      Deserializes a spec from a PairSeq.
      Parameters:
      p - serialized representation
      Returns:
      reconstructed spec
      Throws:
      IllegalArgumentException - if required field is missing
    • toString

      public String toString()
      Overrides:
      toString in class Object