Skip to content

Commit 81ac720

Browse files
author
Fabio Germann
committed
added an implementation of RSA/ECB/OAEPWithSHA-256AndMGF1Padding as it is implemented in java as: RSA/ECB/OAEPWithSHA-256AndMGF1WithSHA-1Padding
1 parent ea14fe4 commit 81ac720

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

crypto/src/security/CipherUtilities.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ private enum CipherPadding
8585
OAEPWITHSHA_224ANDMGF1PADDING,
8686
OAEPWITHSHA256ANDMGF1PADDING,
8787
OAEPWITHSHA_256ANDMGF1PADDING,
88+
OAEPWITHSHA256ANDMGF1WITHSHA256PADDING,
89+
OAEPWITHSHA_256ANDMGF1WITHSHA_256PADDING,
90+
OAEPWITHSHA256ANDMGF1WITHSHA1PADDING,
91+
OAEPWITHSHA_256ANDMGF1WITHSHA_1PADDING,
8892
OAEPWITHSHA384ANDMGF1PADDING,
8993
OAEPWITHSHA_384ANDMGF1PADDING,
9094
OAEPWITHSHA512ANDMGF1PADDING,
@@ -543,8 +547,14 @@ public static IBufferedCipher GetCipher(
543547
break;
544548
case CipherPadding.OAEPWITHSHA256ANDMGF1PADDING:
545549
case CipherPadding.OAEPWITHSHA_256ANDMGF1PADDING:
550+
case CipherPadding.OAEPWITHSHA256ANDMGF1WITHSHA256PADDING:
551+
case CipherPadding.OAEPWITHSHA_256ANDMGF1WITHSHA_256PADDING:
546552
asymBlockCipher = new OaepEncoding(asymBlockCipher, new Sha256Digest());
547553
break;
554+
case CipherPadding.OAEPWITHSHA256ANDMGF1WITHSHA1PADDING:
555+
case CipherPadding.OAEPWITHSHA_256ANDMGF1WITHSHA_1PADDING:
556+
asymBlockCipher = new OaepEncoding(asymBlockCipher, new Sha256Digest(), new Sha1Digest(), null);
557+
break;
548558
case CipherPadding.OAEPWITHSHA384ANDMGF1PADDING:
549559
case CipherPadding.OAEPWITHSHA_384ANDMGF1PADDING:
550560
asymBlockCipher = new OaepEncoding(asymBlockCipher, new Sha384Digest());

0 commit comments

Comments
 (0)