Package zeroecho.core.alg.bike
Class BikePrivateKeySpec
java.lang.Object
zeroecho.core.alg.bike.BikePrivateKeySpec
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionBikePrivateKeySpec(byte[] pkcs8Der) Constructs a new spec from a PKCS#8 encoded private key. -
Method Summary
Modifier and TypeMethodDescriptionstatic PairSeqmarshal(BikePrivateKeySpec spec) Serializes the spec to aPairSeqwith base64 encoding.byte[]pkcs8()Returns a defensive copy of the PKCS#8 encoded key.toString()Returns a diagnostic string including encoded length.static BikePrivateKeySpecDeserializes a spec from aPairSeq.
-
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- ifpkcs8Deris null
-
-
Method Details
-
pkcs8
public byte[] pkcs8()Returns a defensive copy of the PKCS#8 encoded key.- Returns:
- cloned PKCS#8 bytes
-
marshal
Serializes the spec to aPairSeqwith base64 encoding.Fields:
type= "BikePrivateKeySpec"pkcs8.b64= base64 of encoded key (no padding)
- Parameters:
spec- private key specification- Returns:
- serialized key representation
-
unmarshal
Deserializes a spec from aPairSeq.- Parameters:
p- serialized representation containingpkcs8.b64- Returns:
- reconstructed private key spec
- Throws:
IllegalArgumentException- if required field is missing
-
toString
Returns a diagnostic string including encoded length.
-