Class BikePublicKeySpec

java.lang.Object
zeroecho.core.alg.bike.BikePublicKeySpec
All Implemented Interfaces:
AlgorithmKeySpec

public final class BikePublicKeySpec extends Object implements 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 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 - if x509Der is null
  • Method Details

    • x509

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

      public static PairSeq marshal(BikePublicKeySpec spec)
      Serializes the spec to a PairSeq with base64 encoding.

      Fields:

      • type = "BikePublicKeySpec"
      • x509.b64 = base64 of encoded key (no padding)
      Parameters:
      spec - public key specification
      Returns:
      serialized representation
    • unmarshal

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

      public String toString()
      Returns a diagnostic string including encoded length.
      Overrides:
      toString in class Object
      Returns:
      human-readable description