Skip to content
Snippets Groups Projects
Commit 357d67aa authored by Martin Vogel's avatar Martin Vogel
Browse files

refactor(#664): make key size constant

parent 8b5623e3
No related branches found
No related tags found
1 merge request!211#664 Test JWK Generator
......@@ -39,6 +39,8 @@ import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static dev.fitko.fitconnect.cli.keygen.JWKGenerator.DEFAULT_KEY_SIZE;
class CommandExecutor {
private static final Logger LOGGER = LoggerFactory.getLogger(CommandExecutor.class);
......@@ -126,10 +128,8 @@ class CommandExecutor {
LOGGER.info("Generating JWKs ...");
final int keySize = createTestKeysCommand.keySize == 0 ? 4096 : createTestKeysCommand.keySize;
final JWKPair encryptionKeyPair = jwkGenerator.generateEncryptionKeyPair(keySize);
final JWKPair signatureKeyPair = jwkGenerator.generateSignatureKeyPair(keySize);
final JWKPair encryptionKeyPair = jwkGenerator.generateEncryptionKeyPair(DEFAULT_KEY_SIZE);
final JWKPair signatureKeyPair = jwkGenerator.generateSignatureKeyPair(DEFAULT_KEY_SIZE);
final KeyWriterSettings keyWriterSettings = KeyWriterSettings.builder()
.outputDir(createTestKeysCommand.outputDir)
......
......@@ -12,9 +12,6 @@ public class CreateTestKeysCommand {
public static final String CREATE_TEST_KEYS_COMMAND_NAME = "keygen";
@Parameter(names = {"--keySize"}, description = "Unique destination identifier in UUID format", arity = 1)
public int keySize = 4096;
@Parameter(names = {"--outDir"}, description = "Output directory folder where the generated test keys are written to", arity = 1)
public String outputDir;
......
......@@ -38,6 +38,8 @@ import java.util.UUID;
*/
public class JWKGenerator {
public static final int DEFAULT_KEY_SIZE = 4096;
/**
* Generate a set of public encryption key and private decryption key.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment