Integer caid = new Integer(((X509Certificate) cert).getSubjectDN().toString().hashCode());
Integer caid = new Integer(CertTools.getIssuerDN((X509Certificate) cert).hashCode());
    public byte[] createPKCS7(Admin admin, Certificate cert) throws SignRequestSignatureException {        debug(">createPKCS7()");        byte[] returnval = null;                 Integer caid = new Integer(((X509Certificate) cert).getSubjectDN().toString().hashCode());                 // get CA         CADataLocal cadata = null;          try{           cadata = cadatahome.findByPrimaryKey(caid);         }catch(javax.ejb.FinderException fe){                     throw new EJBException(fe);                            }                         CA ca = null;         try{           ca = cadata.getCA();         }catch(java.io.UnsupportedEncodingException uee){           throw new EJBException(uee);            }                         // Check that CA hasn't expired.         X509Certificate cacert = (X509Certificate) ca.getCACertificate();                           try{           cacert.checkValidity();                            }catch(Exception e){           // Signers Certificate has expired.              cadata.setStatus(SecConst.CA_EXPIRED);                    throw new EJBException("Signing CA " + cadata.getSubjectDN() + " has expired");            }                            returnval = ca.createPKCS7(cert);         debug("<createPKCS7()");         return returnval;    } // createPKCS7