diff options
author | Abhishek Koneru <akoneru@redhat.com> | 2012-06-11 16:21:26 -0400 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2012-06-15 17:12:15 -0500 |
commit | 10326ad4fe1b3db620f43feb3f47c4fd008f3f33 (patch) | |
tree | 4d4a0f719bbbea6d6db53ef3fab5f3717411cfb9 /base/util/src/netscape/security/provider/RSAPublicKey.java | |
parent | c53ca291e21761f1de5417ef596afba395a7f5d1 (diff) | |
download | pki-10326ad4fe1b3db620f43feb3f47c4fd008f3f33.tar.gz pki-10326ad4fe1b3db620f43feb3f47c4fd008f3f33.tar.xz pki-10326ad4fe1b3db620f43feb3f47c4fd008f3f33.zip |
Fixes for Coverity issues of type Stringbuffer, NO_EQUALS_METHOD , REVERSE_INULL,Wrong_Map_Iterators
Diffstat (limited to 'base/util/src/netscape/security/provider/RSAPublicKey.java')
-rw-r--r-- | base/util/src/netscape/security/provider/RSAPublicKey.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/base/util/src/netscape/security/provider/RSAPublicKey.java b/base/util/src/netscape/security/provider/RSAPublicKey.java index a70d1aeee..40f5583ac 100644 --- a/base/util/src/netscape/security/provider/RSAPublicKey.java +++ b/base/util/src/netscape/security/provider/RSAPublicKey.java @@ -149,4 +149,36 @@ public final class RSAPublicKey extends X509Key implements Serializable { } } + @Override + public boolean equals(Object object) { + + if (object == null) { + return false; + } + if (object instanceof RSAPublicKey) { + RSAPublicKey rhs = (RSAPublicKey) object; + if (this == rhs) { + return true; + } + if (!(bigIntEquals(this.modulus, rhs.modulus) && bigIntEquals(this.publicExponent, rhs.publicExponent))) { + return false; + } + return super.equals(rhs); + } + + return false; + } + + public boolean bigIntEquals(BigInt x, BigInt y) { + if (x == null) { + if (y != null) { + return false; + } + } else { + if (!x.equals(y)) { + return false; + } + } + return true; + } } |