Class TraceTestKeys

java.lang.Object
io.jans.lock.trace.crypto.bc.testkit.TraceTestKeys

public final class TraceTestKeys extends Object
Test-only Ed25519 helpers shared by the whole TRACE test suite: provider installation, key generation, deterministic keys from RFC 8032 seeds, signing, and RFC 8037 JWK export of public keys (consolidated test kit).
  • Method Details

    • installProvider

      public static void installProvider()
      Installs the BouncyCastle provider through SecurityProviderUtility unless a previous test class already did. Call from @BeforeAll.
    • provider

      public static Provider provider()
    • generateKeyPair

      public static KeyPair generateKeyPair()
    • privateKeyFromSeed

      public static PrivateKey privateKeyFromSeed(byte[] seed)
      Parameters:
      seed - the 32-byte RFC 8032 secret key (seed)
    • publicKeyFromRaw

      public static PublicKey publicKeyFromRaw(byte[] raw)
    • sign

      public static byte[] sign(PrivateKey privateKey, byte[] message)
    • rawPublicKey

      public static byte[] rawPublicKey(PublicKey publicKey)
      Returns:
      the raw 32-byte key extracted from the provider's SubjectPublicKeyInfo encoding
    • toJwk

      public static Map<String,String> toJwk(PublicKey publicKey)
      Returns:
      {"kty":"OKP","crv":"Ed25519","x":"<raw key, base64url>"} (RFC 8037 ยง2)
    • hex

      public static byte[] hex(String hex)