Skip to content

Commit

Permalink
#498: Then switch to the more explicit S/MIME API, manually passing i…
Browse files Browse the repository at this point in the history
…n the defaults from smime-util itself, so we can start replacing it with our own values
  • Loading branch information
bbottema committed Mar 22, 2024
1 parent e2ec9a7 commit bc4f294
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/smime-module/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<dependency>
<groupId>org.simplejavamail</groupId>
<artifactId>utils-mail-smime</artifactId>
<version>2.3.0</version>
<version>2.3.1</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -448,13 +448,16 @@ private static SignerInformationVerifier getVerifier(X509Certificate certificate
@NotNull
@Override
public MimeMessage signMessageWithSmime(@Nullable final Session session, @NotNull final Email email, @NotNull final MimeMessage messageToProtect, @NotNull final Pkcs12Config pkcs12Config) {
return SmimeUtil.sign(session, email.getId(), messageToProtect, retrieveSmimeKeyFromPkcs12Keystore(pkcs12Config));
return SmimeUtil.sign(session, email.getId(), messageToProtect, retrieveSmimeKeyFromPkcs12Keystore(pkcs12Config),
SmimeUtil.DEFAULT_SIGNATURE_ALGORITHM_NAME);
}

@NotNull
@Override
public MimeMessage encryptMessageWithSmime(@Nullable final Session session, @NotNull final Email email, @NotNull final MimeMessage messageToProtect, @NotNull final X509Certificate x509Certificate) {
return SmimeUtil.encrypt(session, email.getId(), messageToProtect, x509Certificate);
return SmimeUtil.encrypt(session, messageToProtect, email.getId(), x509Certificate,
SmimeUtil.DEFAULT_KEY_ENCAPSULATION_ALGORITHM,
SmimeUtil.DEFAULT_CIPHER);
}

@Override
Expand Down

0 comments on commit bc4f294

Please sign in to comment.