Class BikePrivateKeySpec

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

public final class BikePrivateKeySpec extends Object implements AlgorithmKeySpec

Specification for a BIKE private key

Wraps a BIKE private key encoded in standard PKCS#8 format. Provides marshalling and unmarshalling support for interchange.

Usage


 // Import a BIKE private key
 BikePrivateKeySpec spec = new BikePrivateKeySpec(pkcs8Bytes);
 PrivateKey key = bikeAlgorithm.importPrivate(spec);

 // Marshal for storage or transport
 PairSeq seq = BikePrivateKeySpec.marshal(spec);

 // Reconstruct from encoded representation
 BikePrivateKeySpec restored = BikePrivateKeySpec.unmarshal(seq);
 
Since:
1.0
  • Constructor Details

    • BikePrivateKeySpec

      public BikePrivateKeySpec(byte[] pkcs8Der)
      Constructs a new spec from a PKCS#8 encoded private key.
      Parameters:
      pkcs8Der - PKCS#8 bytes (DER encoded)
      Throws:
      NullPointerException - if pkcs8Der is null
  • Method Details

    • pkcs8

      public byte[] pkcs8()
      Returns a defensive copy of the PKCS#8 encoded key.
      Returns:
      cloned PKCS#8 bytes
    • marshal

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

      Fields:

      • type = "BikePrivateKeySpec"
      • pkcs8.b64 = base64 of encoded key (no padding)
      Parameters:
      spec - private key specification
      Returns:
      serialized key representation
    • unmarshal

      public static BikePrivateKeySpec unmarshal(PairSeq p)
      Deserializes a spec from a PairSeq.
      Parameters:
      p - serialized representation containing pkcs8.b64
      Returns:
      reconstructed private 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