From 6e12fd4a65815e68e2c4b81e3a681e5631bfed71 Mon Sep 17 00:00:00 2001 From: Maxim Grischenko Date: Tue, 14 May 2024 14:00:27 +0200 Subject: [PATCH] make sigAlgo configurable --- .../deprecated/generator/CaSignedCertificateBuilder.java | 5 +++++ .../generator/SingleKeyUsageSelfSignedCertBuilder.java | 1 + 2 files changed, 6 insertions(+) diff --git a/security-provider-adapters/bouncycastle-adapter/src/main/java/de/adorsys/keymanagement/bouncycastle/adapter/services/deprecated/generator/CaSignedCertificateBuilder.java b/security-provider-adapters/bouncycastle-adapter/src/main/java/de/adorsys/keymanagement/bouncycastle/adapter/services/deprecated/generator/CaSignedCertificateBuilder.java index 374852d..22909f1 100644 --- a/security-provider-adapters/bouncycastle-adapter/src/main/java/de/adorsys/keymanagement/bouncycastle/adapter/services/deprecated/generator/CaSignedCertificateBuilder.java +++ b/security-provider-adapters/bouncycastle-adapter/src/main/java/de/adorsys/keymanagement/bouncycastle/adapter/services/deprecated/generator/CaSignedCertificateBuilder.java @@ -167,6 +167,11 @@ public CaSignedCertificateBuilder withNotBeforeInDays(Integer notBeforeInDays) { return this; } + public CaSignedCertificateBuilder withSignatureAlgo(String signatureAlgo) { + this.signatureAlgo = signatureAlgo; + return this; + } + public CaSignedCertificateBuilder withKeyUsage(int keyUsage) { if (keyUsageSet) { this.keyUsage = this.keyUsage | keyUsage; diff --git a/security-provider-adapters/bouncycastle-adapter/src/main/java/de/adorsys/keymanagement/bouncycastle/adapter/services/deprecated/generator/SingleKeyUsageSelfSignedCertBuilder.java b/security-provider-adapters/bouncycastle-adapter/src/main/java/de/adorsys/keymanagement/bouncycastle/adapter/services/deprecated/generator/SingleKeyUsageSelfSignedCertBuilder.java index c6f436e..49925ae 100644 --- a/security-provider-adapters/bouncycastle-adapter/src/main/java/de/adorsys/keymanagement/bouncycastle/adapter/services/deprecated/generator/SingleKeyUsageSelfSignedCertBuilder.java +++ b/security-provider-adapters/bouncycastle-adapter/src/main/java/de/adorsys/keymanagement/bouncycastle/adapter/services/deprecated/generator/SingleKeyUsageSelfSignedCertBuilder.java @@ -64,6 +64,7 @@ public SelfSignedKeyPairData build(KeyPair keyPair) { .withNotBeforeInDays(notBeforeInDays) .withNotAfterInDays(notAfterInDays) .withSubjectDN(subjectDN) + .withSignatureAlgo(signatureAlgo) .withSubjectPublicKey(keyPair.getPublic()); if (keyUsages != null) {