|
18 | 18 | */ |
19 | 19 | package de.rwth.idsg.steve.utils; |
20 | 20 |
|
21 | | -import de.rwth.idsg.steve.config.SteveProperties.Ocpp.Security.CsrSigning.LocalCsrSigning.SignatureAlgorithmPolicy; |
22 | 21 | import jooq.steve.db.enums.CertificateSignatureAlgorithm; |
23 | 22 | import lombok.AccessLevel; |
24 | 23 | import lombok.NoArgsConstructor; |
@@ -138,25 +137,14 @@ public static PrivateKey parsePrivateKeyViaBouncyCastle(String privateKeyPem) th |
138 | 137 | } |
139 | 138 | } |
140 | 139 |
|
141 | | - public static String resolveSignatureAlgorithm(PrivateKey privateKey, |
142 | | - SignatureAlgorithmPolicy signatureAlgorithmPolicy) { |
143 | | - var policy = (signatureAlgorithmPolicy == null) |
144 | | - ? SignatureAlgorithmPolicy.AUTO |
145 | | - : signatureAlgorithmPolicy; |
146 | | - |
| 140 | + public static String resolveSignatureAlgorithm(PrivateKey privateKey) { |
147 | 141 | String keyAlgorithm = privateKey.getAlgorithm(); |
148 | 142 | if ("RSA".equalsIgnoreCase(keyAlgorithm)) { |
149 | | - return switch (policy) { |
150 | | - case AUTO, RSA_PSS -> "SHA256withRSAandMGF1"; |
151 | | - case RSA_PKCS1 -> "SHA256WithRSA"; |
152 | | - }; |
| 143 | + return "SHA256withRSAandMGF1"; |
153 | 144 | } |
154 | 145 | if ("EC".equalsIgnoreCase(keyAlgorithm) || "ECDSA".equalsIgnoreCase(keyAlgorithm)) { |
155 | 146 | return "SHA256withECDSA"; |
156 | 147 | } |
157 | | - if ("DSA".equalsIgnoreCase(keyAlgorithm)) { |
158 | | - return "SHA256withDSA"; |
159 | | - } |
160 | 148 | throw new IllegalArgumentException("Unsupported signing private key algorithm: " + keyAlgorithm); |
161 | 149 | } |
162 | 150 |
|
|
0 commit comments