summaryrefslogtreecommitdiffstats
path: root/pki/base/util/src/com/netscape/cmsutil/util/Cert.java
diff options
context:
space:
mode:
authorAde Lee <alee@redhat.com>2012-01-11 12:57:53 -0500
committerAde Lee <alee@redhat.com>2012-01-11 13:49:04 -0500
commit10cfe7756e967ac91c66d33b392aeab9cf3780fb (patch)
treed5ac9b58442265d2ce5ef60e31f041ddacba1b4f /pki/base/util/src/com/netscape/cmsutil/util/Cert.java
parentedcb24f65cc3700e75d0a1d14dc2483f210b0ee4 (diff)
downloadpki-10cfe7756e967ac91c66d33b392aeab9cf3780fb.tar.gz
pki-10cfe7756e967ac91c66d33b392aeab9cf3780fb.tar.xz
pki-10cfe7756e967ac91c66d33b392aeab9cf3780fb.zip
Formatting (no line wrap in comments or code)
Diffstat (limited to 'pki/base/util/src/com/netscape/cmsutil/util/Cert.java')
-rw-r--r--pki/base/util/src/com/netscape/cmsutil/util/Cert.java34
1 files changed, 16 insertions, 18 deletions
diff --git a/pki/base/util/src/com/netscape/cmsutil/util/Cert.java b/pki/base/util/src/com/netscape/cmsutil/util/Cert.java
index d5689ac9d..b280a7600 100644
--- a/pki/base/util/src/com/netscape/cmsutil/util/Cert.java
+++ b/pki/base/util/src/com/netscape/cmsutil/util/Cert.java
@@ -17,7 +17,6 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cmsutil.util;
-
import java.io.IOException;
import java.security.cert.CertificateException;
import java.security.cert.X509CRL;
@@ -63,13 +62,13 @@ public class Cert {
}
if ((s.startsWith("-----BEGIN CERTIFICATE-----")) &&
- (s.endsWith("-----END CERTIFICATE-----"))) {
+ (s.endsWith("-----END CERTIFICATE-----"))) {
return (s.substring(27, (s.length() - 25)));
}
// To support Thawte's header and footer
if ((s.startsWith("-----BEGIN PKCS #7 SIGNED DATA-----")) &&
- (s.endsWith("-----END PKCS #7 SIGNED DATA-----"))) {
+ (s.endsWith("-----END PKCS #7 SIGNED DATA-----"))) {
return (s.substring(35, (s.length() - 33)));
}
@@ -81,23 +80,23 @@ public class Cert {
return s;
}
if ((s.startsWith("-----BEGIN CERTIFICATE REVOCATION LIST-----")) &&
- (s.endsWith("-----END CERTIFICATE REVOCATION LIST-----"))) {
+ (s.endsWith("-----END CERTIFICATE REVOCATION LIST-----"))) {
return (s.substring(43, (s.length() - 41)));
}
return s;
}
public static String stripCertBrackets(String s) {
- return stripBrackets(s);
+ return stripBrackets(s);
}
- // private static BASE64Decoder mDecoder = new BASE64Decoder();
+ // private static BASE64Decoder mDecoder = new BASE64Decoder();
public static X509CertImpl mapCert(String mime64)
- throws IOException {
+ throws IOException {
mime64 = stripCertBrackets(mime64.trim());
String newval = normalizeCertStr(mime64);
- // byte rawPub[] = mDecoder.decodeBuffer(newval);
- byte rawPub[] = OSUtil.AtoB( newval );
+ // byte rawPub[] = mDecoder.decodeBuffer(newval);
+ byte rawPub[] = OSUtil.AtoB(newval);
X509CertImpl cert = null;
try {
@@ -108,27 +107,27 @@ public class Cert {
}
public static X509Certificate[] mapCertFromPKCS7(String mime64)
- throws IOException {
+ throws IOException {
mime64 = stripCertBrackets(mime64.trim());
String newval = normalizeCertStr(mime64);
- // byte rawPub[] = mDecoder.decodeBuffer(newval);
- byte rawPub[] = OSUtil.AtoB( newval );
+ // byte rawPub[] = mDecoder.decodeBuffer(newval);
+ byte rawPub[] = OSUtil.AtoB(newval);
PKCS7 p7 = null;
try {
p7 = new PKCS7(rawPub);
} catch (Exception e) {
- throw new IOException( "p7 is null" );
+ throw new IOException("p7 is null");
}
return p7.getCertificates();
}
public static X509CRL mapCRL(String mime64)
- throws IOException {
+ throws IOException {
mime64 = stripCRLBrackets(mime64.trim());
String newval = normalizeCertStr(mime64);
- // byte rawPub[] = mDecoder.decodeBuffer(newval);
- byte rawPub[] = OSUtil.AtoB( newval );
+ // byte rawPub[] = mDecoder.decodeBuffer(newval);
+ byte rawPub[] = OSUtil.AtoB(newval);
X509CRL crl = null;
try {
@@ -139,7 +138,7 @@ public class Cert {
}
public static X509CRL mapCRL1(String mime64)
- throws IOException {
+ throws IOException {
mime64 = stripCRLBrackets(mime64.trim());
byte rawPub[] = OSUtil.AtoB(mime64);
@@ -187,4 +186,3 @@ public class Cert {
return val;
}
}
-