Skip to content

Commit 2ee1681

Browse files
author
root
committed
Updating AOEP algorithm name.
1 parent 39f92e1 commit 2ee1681

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/main/java/org/nhindirect/stagent/cryptography/bc/DirectNamedJcaJceExtHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public JceAsymmetricKeyUnwrapper createAsymmetricUnwrapper(AlgorithmIdentifier k
3131
*/
3232
if (!StringUtils.isEmpty(providerName) && !providerName.equalsIgnoreCase("BC"))
3333
{
34-
retVal.setAlgorithmMapping(PKCSObjectIdentifiers.id_RSAES_OAEP, "RSA/ECB/OAEP");
34+
retVal.setAlgorithmMapping(PKCSObjectIdentifiers.id_RSAES_OAEP, "RSA/None/OAEPWithSHA1AndMGF1Padding");
3535
}
3636

3737
return retVal;

src/main/java/org/nhindirect/stagent/cryptography/bc/DirectProviderJcaJceExtHelper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ public JceAsymmetricKeyUnwrapper createAsymmetricUnwrapper(AlgorithmIdentifier k
2929

3030
/*
3131
* For a non-BC provider, we need to map the OAEP algorithm OID to a name. Many HSMs do not recognized the algorithm OID and explicitly
32-
* need the name.
32+
* need the name. May need to get sophisticated in later versions to map names for specific HSMs.
3333
*/
3434
if (provider != null && !StringUtils.isEmpty(provider.getName()) && !provider.getName().equalsIgnoreCase("BC"))
3535
{
36-
retVal.setAlgorithmMapping(PKCSObjectIdentifiers.id_RSAES_OAEP, "RSA/ECB/OAEP");
36+
retVal.setAlgorithmMapping(PKCSObjectIdentifiers.id_RSAES_OAEP, "RSA/None/OAEPWithSHA1AndMGF1Padding");
3737
}
3838

3939
return retVal;

0 commit comments

Comments
 (0)