Package org.kapott.hbci.passport

Examples of org.kapott.hbci.passport.HBCIPassportInternal


        return ret;
    }

    public boolean verify()
    {
        HBCIPassportInternal mainPassport=passports.getMainPassport();
        boolean              ret=false;

        if (mainPassport.hasInstSigKey()) {
            String msgName = msg.getName();
            MsgGen gen=handlerdata.getMsgGen();
            Node msgNode = msg.getSyntaxDef(msgName, gen.getSyntax());
            String dontsignAttr = ((Element)msgNode).getAttribute("dontsign");

            if (dontsignAttr.length()==0) {
                if (hasSig()) {
                    readSigHead();
                    try {
                        /* first calculate hash-result, then verify the hashresult. In
                         * most cases, the hash() step will be executed by the signature
                         * algorithm, so the hash() call returns the message as-is.
                         * Currently the only exception is PKCS#1-10, where an extra
                         * round of hashing must be executed before applying the
                         * signature process */
                        String hashdata=collectHashData(0,0);
                        byte[] hashresult=mainPassport.hash(hashdata.getBytes(Comm.ENCODING));
                        ret=mainPassport.verify(hashresult, sigstring.getBytes(Comm.ENCODING));
                    } catch (Exception e) {
                        ret=false;
                    }
                } else {
                    HBCIUtils.log("message has no signature",HBCIUtils.LOG_WARN);
View Full Code Here


        HBCIUtils.init(null,new HBCICallbackConsole());
       
        String nameOld=readParam(args,0,"Filename of old RDH passport file");
        HBCIUtils.setParam("client.passport.RDH.filename",nameOld);
        HBCIUtils.setParam("client.passport.RDH.init","1");
        HBCIPassportInternal passportOld=(HBCIPassportInternal)AbstractHBCIPassport.getInstance("RDH");
       
        String nameNew=readParam(args,1,"Filename of new RDHNew passport file");
        HBCIUtils.setParam("client.passport.RDHNew.filename",nameNew);
        HBCIUtils.setParam("client.passport.RDHNew.init","0");
        HBCIPassportInternal passportNew=(HBCIPassportInternal)AbstractHBCIPassport.getInstance("RDHNew");

        passportNew.setCountry(passportOld.getCountry());
        passportNew.setBLZ(passportOld.getBLZ());
        passportNew.setHost(passportOld.getHost());
        passportNew.setPort(passportOld.getPort());
        passportNew.setUserId(passportOld.getUserId());
        passportNew.setCustomerId(passportOld.getCustomerId());
        passportNew.setSysId(passportOld.getSysId());
        passportNew.setSigId(passportOld.getSigId());
        passportNew.setProfileVersion(passportOld.getProfileVersion());
        passportNew.setHBCIVersion(passportOld.getHBCIVersion());
        passportNew.setBPD(passportOld.getBPD());
        passportNew.setUPD(passportOld.getUPD());
       
        ((HBCIPassportRDHNew)passportNew).setInstSigKey(((AbstractRDHSWPassport)passportOld).getInstSigKey());
        ((HBCIPassportRDHNew)passportNew).setInstEncKey(((AbstractRDHSWPassport)passportOld).getInstEncKey());
        ((HBCIPassportRDHNew)passportNew).setMyPublicSigKey(((AbstractRDHSWPassport)passportOld).getMyPublicSigKey());
        ((HBCIPassportRDHNew)passportNew).setMyPrivateSigKey(((AbstractRDHSWPassport)passportOld).getMyPrivateSigKey());
        ((HBCIPassportRDHNew)passportNew).setMyPublicEncKey(((AbstractRDHSWPassport)passportOld).getMyPublicEncKey());
        ((HBCIPassportRDHNew)passportNew).setMyPrivateEncKey(((AbstractRDHSWPassport)passportOld).getMyPrivateEncKey());
       
        passportNew.saveChanges();
       
        passportOld.close();
        passportNew.close();           
    }
View Full Code Here

      settings.setAttribute("hbcicallback.askpassphrase.force",true);
     
      HBCIUtils.setParam("client.passport.SIZRDHFile.filename",file.getAbsolutePath());
      HBCIUtils.setParam("client.passport.SIZRDHFile.libname",getRDHLib());
      HBCIUtils.setParam("client.passport.SIZRDHFile.init","0");
      HBCIPassportInternal source = (HBCIPassportInternal) AbstractHBCIPassport.getInstance("SIZRDHFile");
      ////////////////////////////////////////////////////////////////////////

      ////////////////////////////////////////////////////////////////////////
      // Jetzt erzeugen wir einen im HBCI4Java-Format und kopieren die Daten
      Logger.info("converting into hbci4java format");
      HBCIUtils.setParam("client.passport.default","RDHNew");
      HBCIUtils.setParam("client.passport.RDHNew.filename",newKey.getAbsolutePath());
      HBCIUtils.setParam("client.passport.RDHNew.init","0");
      HBCIPassportInternal target = (HBCIPassportInternal) AbstractHBCIPassport.getInstance("RDHNew");

      target.setCountry(source.getCountry());
      target.setBLZ(source.getBLZ());
      target.setHost(source.getHost());
      target.setPort(source.getPort());
      target.setUserId(source.getUserId());
      target.setCustomerId(source.getCustomerId());
      target.setSysId(source.getSysId());
      target.setSigId(source.getSigId());
      target.setHBCIVersion(source.getHBCIVersion());
      target.setBPD(source.getBPD());
      target.setUPD(source.getUPD());
         
      ((HBCIPassportRDHNew)target).setInstSigKey(source.getInstSigKey());
      ((HBCIPassportRDHNew)target).setInstEncKey(source.getInstEncKey());
      ((HBCIPassportRDHNew)target).setMyPublicSigKey(source.getMyPublicSigKey());
      ((HBCIPassportRDHNew)target).setMyPrivateSigKey(source.getMyPrivateSigKey());
      ((HBCIPassportRDHNew)target).setMyPublicEncKey(source.getMyPublicEncKey());
      ((HBCIPassportRDHNew)target).setMyPrivateEncKey(source.getMyPrivateEncKey());
         
      target.saveChanges();
      target.close();
      source.close();
      ////////////////////////////////////////////////////////////////////////
      RDHKeyImpl key = new RDHKeyImpl(newKey);
      key.setFormat(new HBCI4JavaFormat()); // wir tragen nicht uns selbst ein - da wir den ja ins HBCI4Java-Format konvertiert haben
      return key;
View Full Code Here

        String libname=readParam(args,1,"Complete filename of SIZ RDH library");

        HBCIUtils.setParam("client.passport.SIZRDHFile.filename",nameOld);
        HBCIUtils.setParam("client.passport.SIZRDHFile.libname",libname);
        HBCIUtils.setParam("client.passport.SIZRDHFile.init","1");
        HBCIPassportInternal passportOld=(HBCIPassportInternal)AbstractHBCIPassport.getInstance("SIZRDHFile");
       
        String nameNew=readParam(args,2,"Filename of new RDHNew passport file");
        HBCIUtils.setParam("client.passport.RDHNew.filename",nameNew);
        HBCIUtils.setParam("client.passport.RDHNew.init","0");
        HBCIPassportInternal passportNew=(HBCIPassportInternal)AbstractHBCIPassport.getInstance("RDHNew");

        passportNew.setCountry(passportOld.getCountry());
        passportNew.setBLZ(passportOld.getBLZ());
        passportNew.setHost(passportOld.getHost());
        passportNew.setPort(passportOld.getPort());
        passportNew.setUserId(passportOld.getUserId());
        passportNew.setCustomerId(passportOld.getCustomerId());
        passportNew.setSysId(passportOld.getSysId());
        passportNew.setSigId(passportOld.getSigId());
        passportNew.setProfileVersion(passportOld.getProfileVersion());
        passportNew.setHBCIVersion(passportOld.getHBCIVersion());
        passportNew.setBPD(passportOld.getBPD());
        passportNew.setUPD(passportOld.getUPD());
       
        ((HBCIPassportRDHNew)passportNew).setInstSigKey(passportOld.getInstSigKey());
        ((HBCIPassportRDHNew)passportNew).setInstEncKey(passportOld.getInstEncKey());
        ((HBCIPassportRDHNew)passportNew).setMyPublicSigKey(passportOld.getMyPublicSigKey());
        ((HBCIPassportRDHNew)passportNew).setMyPrivateSigKey(passportOld.getMyPrivateSigKey());
        ((HBCIPassportRDHNew)passportNew).setMyPublicEncKey(passportOld.getMyPublicEncKey());
        ((HBCIPassportRDHNew)passportNew).setMyPrivateEncKey(passportOld.getMyPrivateEncKey());
       
        passportNew.saveChanges();
       
        passportOld.close();
        passportNew.close();           
    }
View Full Code Here

TOP

Related Classes of org.kapott.hbci.passport.HBCIPassportInternal

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.