Class XmssPublicKeySpec

java.lang.Object
zeroecho.core.alg.xmss.XmssPublicKeySpec
All Implemented Interfaces:
AlgorithmKeySpec

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

XMSS 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

    • XmssPublicKeySpec

      public XmssPublicKeySpec(byte[] x509Der)
      Constructs a new spec from X.509 DER encoded XMSS 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(XmssPublicKeySpec spec)
      Serializes this spec to a PairSeq.
      Parameters:
      spec - the spec to serialize
      Returns:
      serialized representation
    • unmarshal

      public static XmssPublicKeySpec 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