Class XWingPublicKeySpec
java.lang.Object
zeroecho.core.alg.xwing.XWingPublicKeySpec
- All Implemented Interfaces:
AlgorithmKeySpec
Encoded representation of an X-Wing public key in raw format.
X-Wing uses a raw (non-DER) encoding for both public and private keys, as BouncyCastle 1.86 has no JCA/JCE provider binding for X-Wing. The raw encoding is the 1184-byte ML-KEM-768 public key followed by the 32-byte X25519 public key (1216 bytes total).
- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionXWingPublicKeySpec(byte[] raw) Constructs a new spec from raw X-Wing public key bytes. -
Method Summary
-
Constructor Details
-
XWingPublicKeySpec
public XWingPublicKeySpec(byte[] raw) Constructs a new spec from raw X-Wing public key bytes.- Parameters:
raw- raw-encoded public key bytes- Throws:
NullPointerException- ifrawis nullIllegalArgumentException- if the encoding is not exactly 1216 bytes
-
-
Method Details
-
raw
public byte[] raw()Returns a defensive copy of the raw public key bytes.- Returns:
- raw public key bytes
-
marshal
Serializes this spec to aPairSeq.- Parameters:
spec- the spec to serialize- Returns:
- serialized representation
-
unmarshal
Deserializes a spec from aPairSeq.- Parameters:
p- serialized representation- Returns:
- reconstructed spec
- Throws:
IllegalArgumentException- if required field is missing
-
toString
-