Class JsonWebKeyPair.ParameterSpecBuilder

java.lang.Object
de.christofreichardt.json.webkey.JsonWebKey.Builder<JsonWebKeyPair.ParameterSpecBuilder>
de.christofreichardt.json.webkey.JsonWebKeyPair.ParameterSpecBuilder
Enclosing class:
JsonWebKeyPair

public static class JsonWebKeyPair.ParameterSpecBuilder extends JsonWebKey.Builder<JsonWebKeyPair.ParameterSpecBuilder>
A JsonWebKey.Builder for building JsonWebKeyPairs by a provided AlgorithmParameterSpec. The AlgorithmParameterSpec object will internally be used to create an appropriate KeyPair.
Author:
Christof Reichardt
  • Constructor Details

    • ParameterSpecBuilder

      public ParameterSpecBuilder(AlgorithmParameterSpec algorithmParameterSpec)
      Creates the JsonWebKeyPair.ParameterSpecBuilder preconfigured with the given AlgorithmParameterSpec.
      Parameters:
      algorithmParameterSpec - the requested AlgorithmParameterSpec
  • Method Details

    • withSecureRandom

      public JsonWebKeyPair.ParameterSpecBuilder withSecureRandom(SecureRandom secureRandom)
      Indicates the SecureRandom instance to be used when generating the JsonWebKeyPair.
      Parameters:
      secureRandom - the to be used SecureRandom instance
      Returns:
      this JsonWebKeyPair.Builder instance
    • build

      Builds the JsonWebKeyPair with the configured parameters.
      Returns:
      the appropriately configured JsonWebKeyPair instance
      Throws:
      GeneralSecurityException - relayed from the underlying "Java Cryptography Architecture"