diff options
author | Endi Sukma Dewata <edewata@redhat.com> | 2012-02-15 15:01:42 -0600 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2012-02-23 21:14:28 -0600 |
commit | 970e3667eede41e72bb5a4cadf1d056ff526d944 (patch) | |
tree | 4bd18490efeb4245ff739a9c1558520b25a8f992 /pki/base/common/src/com/netscape/cmscore/cert/CertUtils.java | |
parent | 34496a33fbbee462f67410e2ee54a7986b3aedae (diff) | |
download | pki-970e3667eede41e72bb5a4cadf1d056ff526d944.tar.gz pki-970e3667eede41e72bb5a4cadf1d056ff526d944.tar.xz pki-970e3667eede41e72bb5a4cadf1d056ff526d944.zip |
Consolidated BtoA/AtoB invocations.
The OSUtil's BtoA() and AtoB() have been replaced with wrapper
methods in com.netscape.cmsutil.util.Utils to simplify transition
into Base64 codec from Apache Commons library.
Ticket #90
Diffstat (limited to 'pki/base/common/src/com/netscape/cmscore/cert/CertUtils.java')
-rw-r--r-- | pki/base/common/src/com/netscape/cmscore/cert/CertUtils.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/pki/base/common/src/com/netscape/cmscore/cert/CertUtils.java b/pki/base/common/src/com/netscape/cmscore/cert/CertUtils.java index a5c6fec90..9710d63f5 100644 --- a/pki/base/common/src/com/netscape/cmscore/cert/CertUtils.java +++ b/pki/base/common/src/com/netscape/cmscore/cert/CertUtils.java @@ -60,7 +60,7 @@ import com.netscape.certsrv.apps.CMS; import com.netscape.certsrv.base.EBaseException; import com.netscape.certsrv.base.IConfigStore; import com.netscape.certsrv.logging.ILogger; -import com.netscape.osutil.OSUtil; +import com.netscape.cmsutil.util.Utils; /** * Utility class with assorted methods to check for @@ -157,7 +157,7 @@ public class CertUtils { PKCS10 pkcs10 = null; try { - byte[] decodedBytes = com.netscape.osutil.OSUtil.AtoB(normalized); + byte[] decodedBytes = Utils.base64decode(normalized); pkcs10 = new PKCS10(decodedBytes); } catch (Exception e) { @@ -548,7 +548,7 @@ public class CertUtils { public static String toMIME64(X509CertImpl cert) { try { return "-----BEGIN CERTIFICATE-----\n" + - com.netscape.osutil.OSUtil.BtoA(cert.getEncoded()) + + Utils.base64encode(cert.getEncoded()) + "-----END CERTIFICATE-----\n"; } catch (CertificateException e) { } @@ -559,7 +559,7 @@ public class CertUtils { throws IOException { mime64 = stripCertBrackets(mime64.trim()); String newval = normalizeCertStr(mime64); - byte rawPub[] = com.netscape.osutil.OSUtil.AtoB(newval); + byte rawPub[] = Utils.base64decode(newval); X509Certificate cert = null; try { @@ -573,7 +573,7 @@ public class CertUtils { throws IOException { mime64 = stripCertBrackets(mime64.trim()); String newval = normalizeCertStr(mime64); - byte rawPub[] = com.netscape.osutil.OSUtil.AtoB(newval); + byte rawPub[] = Utils.base64decode(newval); PKCS7 p7 = null; try { @@ -588,7 +588,7 @@ public class CertUtils { throws IOException { mime64 = stripCRLBrackets(mime64.trim()); String newval = normalizeCertStr(mime64); - byte rawPub[] = com.netscape.osutil.OSUtil.AtoB(newval); + byte rawPub[] = Utils.base64decode(newval); X509CRL crl = null; try { @@ -601,7 +601,7 @@ public class CertUtils { public static X509CRL mapCRL1(String mime64) throws IOException { mime64 = stripCRLBrackets(mime64.trim()); - byte rawPub[] = OSUtil.AtoB(mime64); + byte rawPub[] = Utils.base64decode(mime64); X509CRL crl = null; try { |