Class BikePublicKeySpec
java.lang.Object
zeroecho.core.alg.bike.BikePublicKeySpec
- All Implemented Interfaces:
AlgorithmKeySpec
Specification for a BIKE public key
Wraps a BIKE public key encoded in standard X.509 format. Provides marshalling and unmarshalling support for serialization.Usage
// Import a BIKE public key
BikePublicKeySpec spec = new BikePublicKeySpec(x509Bytes);
PublicKey key = bikeAlgorithm.publicKeyImporter(BikePublicKeySpec.class).importPublic(spec);
// Marshal for transport or storage
PairSeq seq = BikePublicKeySpec.marshal(spec);
// Reconstruct from encoded representation
BikePublicKeySpec restored = BikePublicKeySpec.unmarshal(seq);
- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionBikePublicKeySpec(byte[] x509Der) Constructs a new spec from an X.509 encoded public key. -
Method Summary
Modifier and TypeMethodDescriptionstatic PairSeqmarshal(BikePublicKeySpec spec) Serializes the spec to aPairSeqwith base64 encoding.toString()Returns a diagnostic string including encoded length.static BikePublicKeySpecDeserializes a spec from aPairSeq.byte[]x509()Returns a defensive copy of the X.509 encoded key.
-
Constructor Details
-
BikePublicKeySpec
public BikePublicKeySpec(byte[] x509Der) Constructs a new spec from an X.509 encoded public key.- Parameters:
x509Der- X.509 bytes (DER encoded)- Throws:
NullPointerException- ifx509Deris null
-
-
Method Details
-
x509
public byte[] x509()Returns a defensive copy of the X.509 encoded key.- Returns:
- cloned X.509 bytes
-
marshal
Serializes the spec to aPairSeqwith base64 encoding.Fields:
type= "BikePublicKeySpec"x509.b64= base64 of encoded key (no padding)
- Parameters:
spec- public key specification- Returns:
- serialized representation
-
unmarshal
Deserializes a spec from aPairSeq.- Parameters:
p- serialized representation containingx509.b64- Returns:
- reconstructed public key spec
- Throws:
IllegalArgumentException- if required field is missing
-
toString
-