Package org.jpos.util

Examples of org.jpos.util.SimpleMsg


            ,String accoutNo, String acctSeqNo, byte[] arqc, byte[] atc, byte[] upn
            ,byte[] transData, ARPCMethod arpcMethod, byte[] arc, byte[] propAuthData)
            throws SMException {

      SimpleMsg[] cmdParameters = {
            new SimpleMsg("parameter", "mkd method", mkdm),
            new SimpleMsg("parameter", "skd method", skdm),
            new SimpleMsg("parameter", "imk-ac", imkac),
            new SimpleMsg("parameter", "account number", accoutNo),
            new SimpleMsg("parameter", "accnt seq no", acctSeqNo),
            new SimpleMsg("parameter", "arqc", arqc == null ? "" : ISOUtil.hexString(arqc)),
            new SimpleMsg("parameter", "atc", atc == null ? "" : ISOUtil.hexString(atc)),
            new SimpleMsg("parameter", "upn", upn == null ? "" : ISOUtil.hexString(upn)),
            new SimpleMsg("parameter", "trans. data", transData == null ? "" : ISOUtil.hexString(transData)),
            new SimpleMsg("parameter", "arpc gen. method", arpcMethod),
            new SimpleMsg("parameter", "auth. rc", arc == null ? "" : ISOUtil.hexString(arc)),
            new SimpleMsg("parameter", "prop auth. data", propAuthData == null
                                       ? "" : ISOUtil.hexString(propAuthData))
      };
      LogEvent evt = new LogEvent(this, "s-m-operation");
      evt.addMessage(new SimpleMsg("command", "Genarate ARPC", cmdParameters));
      try {
        byte[] result = verifyARQCGenerateARPCImpl( mkdm, skdm, imkac, accoutNo,
                acctSeqNo, arqc, atc, upn, transData, arpcMethod, arc, propAuthData );
        evt.addMessage(new SimpleMsg("result", "ARPC", result == null ? "" : ISOUtil.hexString(result)));
        return result;
      } catch (Exception e) {
        evt.addMessage(e);
        throw e instanceof SMException ? (SMException) e : new SMException(e);
      } finally {
View Full Code Here


    public byte[] generateSM_MAC(MKDMethod mkdm, SKDMethod skdm
            ,SecureDESKey imksmi, String accountNo, String acctSeqNo
            ,byte[] atc, byte[] arqc, byte[] data) throws SMException {

      SimpleMsg[] cmdParameters = {
            new SimpleMsg("parameter", "mkd method", mkdm),
            new SimpleMsg("parameter", "skd method", skdm),
            new SimpleMsg("parameter", "imk-smi", imksmi),
            new SimpleMsg("parameter", "account number", accountNo),
            new SimpleMsg("parameter", "accnt seq no", acctSeqNo),
            new SimpleMsg("parameter", "atc", atc == null ? "" : ISOUtil.hexString(atc)),
            new SimpleMsg("parameter", "arqc", arqc == null ? "" : ISOUtil.hexString(arqc)),
            new SimpleMsg("parameter", "data", data == null ? "" : ISOUtil.hexString(data))
      };
      LogEvent evt = new LogEvent(this, "s-m-operation");
      evt.addMessage(new SimpleMsg("command", "Generate Secure Messaging MAC", cmdParameters));
      try {
        byte[] mac = generateSM_MACImpl( mkdm, skdm, imksmi, accountNo, acctSeqNo, atc, arqc, data);
        evt.addMessage(new SimpleMsg("result", "Generated MAC", mac!=null ? ISOUtil.hexString(mac) : ""));
        return mac;
      } catch (Exception e) {
        evt.addMessage(e);
        throw e instanceof SMException ? (SMException) e : new SMException(e);
      } finally {
View Full Code Here

           ,byte[] data, EncryptedPIN currentPIN, EncryptedPIN newPIN
           ,SecureDESKey kd1, SecureDESKey imksmc, SecureDESKey imkac
           ,byte destinationPINBlockFormat) throws SMException {

      List<Loggeable> cmdParameters = new ArrayList<Loggeable>();
      cmdParameters.add(new SimpleMsg("parameter", "mkd method", mkdm));
      cmdParameters.add(new SimpleMsg("parameter", "skd method", skdm));
      if (padm!=null)
        cmdParameters.add(new SimpleMsg("parameter", "padding method", padm));
      cmdParameters.add(new SimpleMsg("parameter", "imk-smi", imksmi));
      cmdParameters.add(new SimpleMsg("parameter", "account number", accountNo));
      cmdParameters.add(new SimpleMsg("parameter", "accnt seq no", acctSeqNo));
      cmdParameters.add(new SimpleMsg("parameter", "atc", atc == null ? "" : ISOUtil.hexString(atc)));
      cmdParameters.add(new SimpleMsg("parameter", "arqc", arqc == null ? "" : ISOUtil.hexString(arqc)));
      cmdParameters.add(new SimpleMsg("parameter", "data", data == null ? "" : ISOUtil.hexString(data)));
      cmdParameters.add(new SimpleMsg("parameter", "Current Encrypted PIN", currentPIN));
      cmdParameters.add(new SimpleMsg("parameter", "New Encrypted PIN", newPIN));
      cmdParameters.add(new SimpleMsg("parameter", "Source PIN Encryption Key", kd1));
      cmdParameters.add(new SimpleMsg("parameter", "imk-smc", imksmc));
      if (imkac!=null)
        cmdParameters.add(new SimpleMsg("parameter", "imk-ac", imkac));
      cmdParameters.add(new SimpleMsg("parameter", "Destination PIN Block Format", destinationPINBlockFormat));
      LogEvent evt = new LogEvent(this, "s-m-operation");
      evt.addMessage(new SimpleMsg("command", "Translate PIN block format and Generate Secure Messaging MAC"
                    ,cmdParameters.toArray(new Loggeable[cmdParameters.size()])));
      try {
        Pair<EncryptedPIN,byte[]> r = translatePINGenerateSM_MACImpl( mkdm, skdm
                ,padm, imksmi, accountNo, acctSeqNo, atc, arqc, data, currentPIN
                ,newPIN, kd1, imksmc, imkac, destinationPINBlockFormat);
        SimpleMsg[] cmdResults = {
              new SimpleMsg("result", "Translated PIN block", r.getValue0()),
              new SimpleMsg("result", "Generated MAC", r.getValue1() == null ? "" : ISOUtil.hexString(r.getValue1()))
        };
        evt.addMessage(new SimpleMsg("results", "Complex results", cmdResults));
        return r;
      } catch (Exception e) {
        evt.addMessage(e);
        throw e instanceof SMException ? (SMException) e : new SMException(e);
      } finally {
View Full Code Here

    }

    @Override
    public byte[] generateCBC_MAC (byte[] data, SecureDESKey kd) throws SMException {
        SimpleMsg[] cmdParameters =  {
            new SimpleMsg("parameter", "data", data), new SimpleMsg("parameter", "data key",
                    kd),
        };
        LogEvent evt = new LogEvent(this, "s-m-operation");
        evt.addMessage(new SimpleMsg("command", "Generate CBC-MAC", cmdParameters));
        byte[] result = null;
        try {
            result = generateCBC_MACImpl(data, kd);
            evt.addMessage(new SimpleMsg("result", "CBC-MAC", result));
        } catch (Exception e) {
            evt.addMessage(e);
            throw  e instanceof SMException ? (SMException) e : new SMException(e);
        } finally {
            Logger.log(evt);
View Full Code Here

    }

    @Override
    public byte[] generateEDE_MAC (byte[] data, SecureDESKey kd) throws SMException {
        SimpleMsg[] cmdParameters =  {
            new SimpleMsg("parameter", "data", data), new SimpleMsg("parameter", "data key",
                    kd),
        };
        LogEvent evt = new LogEvent(this, "s-m-operation");
        evt.addMessage(new SimpleMsg("command", "Generate EDE-MAC", cmdParameters));
        byte[] result = null;
        try {
            result = generateEDE_MACImpl(data, kd);
            evt.addMessage(new SimpleMsg("result", "EDE-MAC", result));
        } catch (Exception e) {
            evt.addMessage(e);
            throw  e instanceof SMException ? (SMException) e : new SMException(e);
        } finally {
            Logger.log(evt);
View Full Code Here

    }

    @Override
    public SecureDESKey translateKeyFromOldLMK (SecureDESKey kd) throws SMException {
        SimpleMsg[] cmdParameters =  {
            new SimpleMsg("parameter", "Key under old LMK", kd)
        };
        LogEvent evt = new LogEvent(this, "s-m-operation");
        evt.addMessage(new SimpleMsg("command", "Translate Key from old to new LMK", cmdParameters));
        SecureDESKey result = null;
        try {
            result = translateKeyFromOldLMKImpl(kd);
            evt.addMessage(new SimpleMsg("result", "Translated Key under new LMK", result));
        } catch (Exception e) {
            evt.addMessage(e);
            throw  e instanceof SMException ? (SMException) e : new SMException(e);
        } finally {
            Logger.log(evt);
View Full Code Here

    @Override
    public void eraseOldLMK () throws SMException {
        SimpleMsg[] cmdParameters =  {
        };
        LogEvent evt = new LogEvent(this, "s-m-operation");
        evt.addMessage(new SimpleMsg("command", "Erase the key change storage", cmdParameters));
        try {
            eraseOldLMKImpl();
        } catch (Exception e) {
            evt.addMessage(e);
            throw  e instanceof SMException ? (SMException) e : new SMException(e);
View Full Code Here

TOP

Related Classes of org.jpos.util.SimpleMsg

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.