Use a MIME Base64 decoder for attachment signing keys.
This commit is contained in:
parent
4b42dd1db3
commit
59e401f41e
|
@ -76,7 +76,7 @@ public class CanonicalRequestSigner {
|
|||
if (matcher.matches()) {
|
||||
try {
|
||||
final KeyFactory keyFactory = KeyFactory.getInstance("RSA");
|
||||
final PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(Base64.getDecoder().decode(matcher.group(1)));
|
||||
final PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(Base64.getMimeDecoder().decode(matcher.group(1)));
|
||||
final PrivateKey key = keyFactory.generatePrivate(keySpec);
|
||||
|
||||
testKeyIsValidForSigning(key);
|
||||
|
|
|
@ -64,7 +64,7 @@ public class AttachmentControllerTest {
|
|||
final KeyPair keyPair = keyPairGenerator.generateKeyPair();
|
||||
|
||||
RSA_PRIVATE_KEY_PEM = "-----BEGIN PRIVATE KEY-----\n" +
|
||||
Base64.getEncoder().encodeToString(keyPair.getPrivate().getEncoded()) + "\n" +
|
||||
Base64.getMimeEncoder().encodeToString(keyPair.getPrivate().getEncoded()) + "\n" +
|
||||
"-----END PRIVATE KEY-----";
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
throw new AssertionError(e);
|
||||
|
|
Loading…
Reference in New Issue