Class Ed448PublicKeySpec
java.lang.Object
zeroecho.core.alg.ed448.Ed448PublicKeySpec
- All Implemented Interfaces:
AlgorithmKeySpec
Ed448 Public Key Specification
Immutable specification for an Ed448 public key in X.509 encoding.
This class acts as a typed carrier for encoded public key material, typically
used with Ed448PublicKeyBuilder to reconstruct a usable
PublicKey. It also provides marshal/unmarshal helpers
to serialize the key into a portable PairSeq representation.
Encoding
- The byte array is expected to contain a valid X.509-encoded Ed448 public key.
- The constructor defensively clones the provided array, and
encoded()returns a fresh copy on each call. - The
marshal(Ed448PublicKeySpec)andunmarshal(PairSeq)methods wrap and unwrap the X.509 bytes using base64 without padding.
Usage
// Wrap existing X.509-encoded bytes
Ed448PublicKeySpec spec = new Ed448PublicKeySpec(x509Bytes);
// Import into JCA PublicKey via builder
PublicKey key = new Ed448PublicKeyBuilder().importPublic(spec);
// Serialize to PairSeq (e.g., for transport)
PairSeq p = Ed448PublicKeySpec.marshal(spec);
// Deserialize from PairSeq
Ed448PublicKeySpec restored = Ed448PublicKeySpec.unmarshal(p);
Thread-safety
Instances are immutable and safe to share across threads.- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionEd448PublicKeySpec(byte[] encodedX509) Constructs a new Ed448 public key spec from the given X.509-encoded bytes. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]encoded()Returns a defensive copy of the X.509-encoded public key bytes.static PairSeqmarshal(Ed448PublicKeySpec spec) Serializes this key spec into aPairSeqrecord.static Ed448PublicKeySpecDeserializes aPairSeqinto a newEd448PublicKeySpec.
-
Constructor Details
-
Ed448PublicKeySpec
public Ed448PublicKeySpec(byte[] encodedX509) Constructs a new Ed448 public key spec from the given X.509-encoded bytes.- Parameters:
encodedX509- X.509-encoded Ed448 public key (non-null)- Throws:
IllegalArgumentException- ifencodedX509isnull
-
-
Method Details
-
encoded
public byte[] encoded()Returns a defensive copy of the X.509-encoded public key bytes.- Returns:
- cloned X.509-encoded key bytes
-
marshal
-
unmarshal
Deserializes aPairSeqinto a newEd448PublicKeySpec.Expects a field
"x509.b64"containing the base64-encoded X.509 public key bytes. Other fields are ignored.- Parameters:
p- the serialized pair sequence- Returns:
- a reconstructed
Ed448PublicKeySpec - Throws:
IllegalArgumentException- ifx509.b64is missing
-