From 1c8437891cdfe5580e09c495f79d81334ed0c2c0 Mon Sep 17 00:00:00 2001 From: Endi Sukma Dewata Date: Wed, 28 Mar 2012 00:36:32 -0500 Subject: Replaced deprecated AlgorithmId.getAlgorithmId(). The deprecated getAlgorithmId() method in AlgorithmId has been replaced with get(). Ticket #3 --- .../netscape/cms/profile/common/EnrollProfile.java | 31 ++++++++++------------ .../cms/profile/def/SigningAlgDefault.java | 7 +++-- 2 files changed, 17 insertions(+), 21 deletions(-) (limited to 'base/common/src/com/netscape/cms/profile') diff --git a/base/common/src/com/netscape/cms/profile/common/EnrollProfile.java b/base/common/src/com/netscape/cms/profile/common/EnrollProfile.java index d574f0f94..6fbdddb69 100644 --- a/base/common/src/com/netscape/cms/profile/common/EnrollProfile.java +++ b/base/common/src/com/netscape/cms/profile/common/EnrollProfile.java @@ -100,7 +100,7 @@ import com.netscape.cmsutil.util.HMACDigest; /** * This class implements a generic enrollment profile. - * + * * @version $Revision$, $Date$ */ public abstract class EnrollProfile extends BasicProfile @@ -167,7 +167,7 @@ public abstract class EnrollProfile extends BasicProfile num_requests = msgs.length; } - // only 1 request for renewal + // only 1 request for renewal if ((is_renewal != null) && (is_renewal.equals("true"))) { num_requests = 1; String renewal_seq_num_str = ctx.get(CTX_RENEWAL_SEQ_NUM); @@ -229,8 +229,7 @@ public abstract class EnrollProfile extends BasicProfile info.set(X509CertInfo.VALIDITY, new CertificateValidity(new Date(), new Date())); info.set(X509CertInfo.ALGORITHM_ID, - new CertificateAlgorithmId( - AlgorithmId.getAlgorithmId("MD5withRSA"))); + new CertificateAlgorithmId(AlgorithmId.get("MD5withRSA"))); // add default extension container info.set(X509CertInfo.EXTENSIONS, @@ -281,7 +280,7 @@ public abstract class EnrollProfile extends BasicProfile Enumeration setIds = getProfilePolicySetIds(); while (setIds.hasMoreElements()) { - String setId = (String) setIds.nextElement(); + String setId = setIds.nextElement(); if (count == seq_no) { return setId; @@ -323,8 +322,7 @@ public abstract class EnrollProfile extends BasicProfile // } // } - IAuthority authority = (IAuthority) - getAuthority(); + IAuthority authority = getAuthority(); IRequestQueue queue = authority.getRequestQueue(); // this profile queues request that is authenticated @@ -376,7 +374,7 @@ public abstract class EnrollProfile extends BasicProfile org.mozilla.jss.pkix.cms.ContentInfo cmcReq = (org.mozilla.jss.pkix.cms.ContentInfo) org.mozilla.jss.pkix.cms.ContentInfo.getTemplate().decode(cmcBlobIn); - org.mozilla.jss.pkix.cms.SignedData cmcFullReq = + org.mozilla.jss.pkix.cms.SignedData cmcFullReq = (org.mozilla.jss.pkix.cms.SignedData) cmcReq.getInterpretedContent(); org.mozilla.jss.pkix.cms.EncapsulatedContentInfo ci = cmcFullReq.getContentInfo(); OCTET_STRING content = ci.getContent(); @@ -1056,8 +1054,7 @@ public abstract class EnrollProfile extends BasicProfile PKCS10Attributes p10Attrs = pkcs10.getAttributes(); if (p10Attrs != null) { - PKCS10Attribute p10Attr = (PKCS10Attribute) - (p10Attrs.getAttribute(CertificateExtensions.NAME)); + PKCS10Attribute p10Attr = p10Attrs.getAttribute(CertificateExtensions.NAME); if (p10Attr != null && p10Attr.getAttributeId().equals( PKCS9Attribute.EXTENSION_REQUEST_OID)) { CMS.debug("Found PKCS10 extension"); @@ -1237,16 +1234,16 @@ public abstract class EnrollProfile extends BasicProfile /** * Populate input *

- * + * * (either all "agent" profile cert requests NOT made through a connector, or all "EE" profile cert requests NOT * made through a connector) *

- * + * *

- * + * * @param ctx profile context * @param request the certificate request * @exception EProfileException an error related to this profile has @@ -1357,12 +1354,12 @@ public abstract class EnrollProfile extends BasicProfile /** * Signed Audit Log Requester ID - * + * * This method is inherited by all extended "EnrollProfile"s, * and is called to obtain the "RequesterID" for * a signed audit log message. *

- * + * * @param request the actual request * @return id string containing the signed audit log message RequesterID */ @@ -1388,12 +1385,12 @@ public abstract class EnrollProfile extends BasicProfile /** * Signed Audit Log Profile ID - * + * * This method is inherited by all extended "EnrollProfile"s, * and is called to obtain the "ProfileID" for * a signed audit log message. *

- * + * * @return id string containing the signed audit log message ProfileID */ protected String auditProfileID() { diff --git a/base/common/src/com/netscape/cms/profile/def/SigningAlgDefault.java b/base/common/src/com/netscape/cms/profile/def/SigningAlgDefault.java index 11da93fc8..81ad58c73 100644 --- a/base/common/src/com/netscape/cms/profile/def/SigningAlgDefault.java +++ b/base/common/src/com/netscape/cms/profile/def/SigningAlgDefault.java @@ -37,7 +37,7 @@ import com.netscape.certsrv.request.IRequest; * This class implements an enrollment default policy * that populates a signing algorithm * into the certificate template. - * + * * @version $Revision$, $Date$ */ public class SigningAlgDefault extends EnrollDefault { @@ -121,7 +121,7 @@ public class SigningAlgDefault extends EnrollDefault { try { info.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId( - AlgorithmId.getAlgorithmId(value))); + AlgorithmId.get(value))); } catch (Exception e) { CMS.debug("SigningAlgDefault: setValue " + e.toString()); throw new EPropertyException(CMS.getUserMessage( @@ -174,8 +174,7 @@ public class SigningAlgDefault extends EnrollDefault { throws EProfileException { try { info.set(X509CertInfo.ALGORITHM_ID, - new CertificateAlgorithmId( - AlgorithmId.getAlgorithmId(getSigningAlg()))); + new CertificateAlgorithmId(AlgorithmId.get(getSigningAlg()))); } catch (Exception e) { CMS.debug("SigningAlgDefault: populate " + e.toString()); } -- cgit