summaryrefslogtreecommitdiffstats
path: root/base/util
diff options
context:
space:
mode:
authorAbhishek Koneru <akoneru@redhat.com>2012-05-18 11:44:45 -0400
committerAde Lee <alee@redhat.com>2012-05-24 23:08:07 -0400
commita6fca9587905f455c4b0306b02d77334a295305e (patch)
treeeddf6a64341dafd126467d2abccdbbd7c8f05a72 /base/util
parent739c50ee20704128e0bf4605ba7ca392d95070a2 (diff)
downloadpki-a6fca9587905f455c4b0306b02d77334a295305e.tar.gz
pki-a6fca9587905f455c4b0306b02d77334a295305e.tar.xz
pki-a6fca9587905f455c4b0306b02d77334a295305e.zip
Fixes for Coverity Defects of Category : FB.BC_VACUOUS_INSTANCEOF
Diffstat (limited to 'base/util')
-rw-r--r--base/util/src/netscape/security/x509/X509Cert.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/base/util/src/netscape/security/x509/X509Cert.java b/base/util/src/netscape/security/x509/X509Cert.java
index 9162cc92f..ea1e26deb 100644
--- a/base/util/src/netscape/security/x509/X509Cert.java
+++ b/base/util/src/netscape/security/x509/X509Cert.java
@@ -159,9 +159,9 @@ public class X509Cert implements Certificate, Serializable {
Date notAfter) throws CertException {
subject = subjectName;
- if (!(subjectPublicKey instanceof PublicKey))
+ if (subjectPublicKey == null)
throw new CertException(CertException.err_INVALID_PUBLIC_KEY,
- "Doesn't implement PublicKey interface");
+ "Public Key is NULL");
/*
* The X509 cert API requires X509 keys, else things break.
@@ -402,11 +402,11 @@ public class X509Cert implements Certificate, Serializable {
String algorithm;
Signature sig;
- if (privateKey instanceof Key) {
+ if (privateKey != null) {
Key key = privateKey;
algorithm = key.getAlgorithm();
} else {
- throw new InvalidKeyException("private key not a key!");
+ throw new InvalidKeyException("Private Key is NULL");
}
sig = Signature.getInstance(algorithmId.getName());