Class BikeKeySupport

java.lang.Object
zeroecho.sdk.util.BikeKeySupport

public final class BikeKeySupport extends Object
BIKE-256 key pair utilities for modules that depend on zeroecho.lib.

BouncyCastle is an internal implementation detail of zeroecho.lib. This class provides BIKE key-pair operations through standard JCA types (KeyPair, PublicKey, PrivateKey) so that callers do not need to depend on BouncyCastle directly.

  • Method Details

    • generateKeyPair

      public static KeyPair generateKeyPair() throws GeneralSecurityException
      Generates a fresh BIKE-256 key pair using the BCPQC provider.
      Returns:
      a new key pair whose private key is owned by the caller
      Throws:
      GeneralSecurityException - if the provider or key generator is unavailable
    • loadPublicKey

      public static PublicKey loadPublicKey(byte[] x509Der) throws GeneralSecurityException
      Decodes a BIKE public key from a SubjectPublicKeyInfo structure. The parameter set is taken from the encoding; this method does not restrict imported keys to BIKE-256.
      Parameters:
      x509Der - non-null DER-encoded SubjectPublicKeyInfo
      Returns:
      the decoded public key
      Throws:
      GeneralSecurityException - if the provider is unavailable or the encoding is invalid
    • loadPrivateKey

      public static PrivateKey loadPrivateKey(byte[] pkcs8Der) throws GeneralSecurityException
      Decodes a BIKE private key from a PKCS#8 structure. The parameter set is taken from the encoding. The caller remains responsible for protecting and clearing its input byte array.
      Parameters:
      pkcs8Der - non-null DER-encoded private key
      Returns:
      the decoded private key, owned by the caller
      Throws:
      GeneralSecurityException - if the provider is unavailable or the encoding is invalid