Skip to content

Commit 13cfd02

Browse files
committed
Improved instanceof check
1 parent 9783a26 commit 13cfd02

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/main/java/org/bouncycastle/crypto/kems/ECIESKEMGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ private ECMultiplier createBasePointMultiplier()
100100

101101
public SecretWithEncapsulation generateEncapsulated(AsymmetricKeyParameter recipientKey)
102102
{
103-
if (!(recipientKey instanceof ECKeyParameters))
103+
if (!(recipientKey instanceof ECPublicKeyParameters))
104104
{
105-
throw new IllegalArgumentException("EC key required");
105+
throw new IllegalArgumentException("EC public key required");
106106
}
107107

108108
ECPublicKeyParameters ecPubKey = (ECPublicKeyParameters)recipientKey;

0 commit comments

Comments
 (0)