public void assinar() throws IOException, Exception{
        int index = s.getCertificateList().getSelectionModel().getLeadSelectionIndex();
        //System.out.println(s.getSigners().get(index));
        ICPBrasilSigner signer = s.getSigners().get(index);
//        System.out.println(new File("xmls/1.xml").exists());
              
        FirstSignature command = new FirstSignature(new File("xmls/"+codRenavam+".xml"), signer);
        File f = new File("assinados/"+codRenavam+".p7s");
        if(f.exists())
            f.delete();
        
        FileOutputStream assinado =  new FileOutputStream(new File("assinados/"+codRenavam+".p7s"));
        
        assinado.write(command.execute(SignType.ADRB1V0));
        assinado.close();
        
        if(wirzzard){
         //   this.conectarLeitora();
            
            ControllerSmartCard cs = new ControllerSmartCard(null, null);
            cs.conectarLeitora();
            String result = cs.gravar("assinados/"+codRenavam+".p7s");
            System.out.println(result);
        }
                
    }