com.pax.dal

Interface IPedKeyIsolationManager

    • Method Detail

      • convertPinBlock

        byte[] convertPinBlock(byte pinpadTPKIndex,
                               byte pinpadTPKType,
                               byte[] pinpadPinBlock,
                               byte dstTPKIndex,
                               byte dstKeyType,
                               byte[] dataIn,
                               byte mode)
                        throws PedDevException
        将session TPK转为online TPK。
        Translate a session TPK to online TPK.
        Parameters:
        pinpadTPKIndex -
        上位机与PINPAD的约定秘钥PED_PPAD_TPK,取值范围:1~100。
        Session TPK(type is PED_PPAD_TPK).Value range:1~100
        pinpadTPKType -
        pinpadTPKindex的类型(PED_PPAD_TPK\PED_AES_PPAD_TPK)
        Type of pinpadTPKindex (PED_PPAD_TPK\PED_AES_PPAD_TPK)
        pinpadPinBlock -
        8字节,从pinpad转换的pinblock,必须使用ISO9564 格式 1。
        8 bytes, pinblock converted from pinpad, must use ISO9564 format 1
        dstTPKIndex -
        必须是online TPK。类型是PED_TPK或PED_TIK,索引1-100 。
        Must be an online TPK. Type is PED_TPK or PED_TIK, index 1-100.
        dstKeyType -
        • 0x03:TPK
        • 0x07:TIK
        • 0x23:AES_TPK
        • 0x51:AES_TIK
        • 0x03:TPK
        • 0x07:TIK
        • 0x23:AES_TPK
        • 0x51:AES_TIK
        dataIn -
        • 当mode=0x00时, DataIn指向卡号移位后生成的16位主帐号。
        • 当mode=0x01时, 参考 ISO9564规范。
        • 当mode=0x02时, 参考 ISO9564规范
        • 当mode=0x03时, 为交易流水号ISN [6 Bytes,ASCII码]
        • When mode=0x00, DataIn is the 16 bytes primary account number after shifting.
        • When mode=0x01, Reference ISO9564 specification.
        • When mode=0x02, Reference ISO9564 specification.
        • When mode=0x03, dataIn is ISN [6 Bytes, ASCII code].
        mode -
        PIN Block的格式。
        • 0x00:ISO9564 格式 0
        • 0x01:ISO9564 格式 1
        • 0x02:ISO9564 格式 3
        • 0x03:HK EPS 专用格式
        PIN Block format.
        • 0x00:ISO9564 format 0
        • 0x01:ISO9564 format 1
        • 0x02:ISO9564 format 3
        • 0x03:HK EPS -EPS PINBLOCK Format
        Returns:
        16字节的目的PINBlock。
        16-bytes pin block.
        Throws:
        PedDevException
        Since:
        V4.03.00
      • genRandomKeyForNP

        void genRandomKeyForNP(int keyIdx,
                               int keyType,
                               int keyLen)
                        throws PedDevException
        生成一个随机密钥
        Generate a random key.
        Parameters:
        keyIdx -
        密钥索引[1~100]
        1~100: Index of key.
        keyType -
        PED_TSK(0x40):用于发散的密钥种子
        PED_TSK(0x40):Seed key for diversification
        keyLen -
        8/16/24
        8/16/24
        Throws:
        PedDevException
      • writeKeyVarForNP

        void writeKeyVarForNP(int srcKeyType,
                              int srcKeyIdx,
                              int dstKeyType,
                              int dstKeyIdx,
                              byte[] keyVar)
                       throws PedDevException
        将srcKeyType指定的源密钥与keyVar异或生成一个新的dstKeyIdx类型的密钥,并将新的密钥保存到dstKeyType。
        Generate a new dstKeyType key by XOR-ing keyVar using the source key specified by srcKeyType and store the new key to dstKeyIdx.
        Parameters:
        srcKeyType -
        源密钥类型。PED_TSK(0x40)。
        The source key type. PED_TSK(0x40).
        srcKeyIdx -
        源密钥索引[1~100]
        The source key index, the valid range is 1~100.
        dstKeyType -
        dstKeyIdx -
        目的密钥索引[1~100]
        The destination key index, the valid range is 1~100.
        keyVar -
        与PED_TSK异或的常量值,长度与PED_TSK相同。
        • 当dstKeyType为EPedKeyType.TAESK时,PED_TSK的长度为16或者24字节。
        • 否则,PED_TSK的长度为24字节。
        The constant value to be XORed by PED_TSK. and length is the same as PED_TSK.
        • When dstKeyType EPedKeyType.TAESK, PED_TSK length is 16 or 24 bytes.
        • Otherwise, PED_TSK length is 24 bytes.
        Throws:
        PedDevException
      • increaseAesDukptKsn

        void increaseAesDukptKsn(byte groupIdx)
                          throws PedDevException
        KSN 加 1
        KSN plus 1
        Parameters:
        groupIdx -
        [1~40]AES DUKPT密钥组索引号。每个 KSN 对应的 AES DUKPT 密钥, 每次使用DUKPT后,建议调用该接口,给ksn加1,保证一次一密
        [1~40]AES DUKPT key group index. AES DUKPT key corresponding to each KSN. After each DUKPT is used, you are advised to call this interface and add 1 to the ksn to ensure one password at a time
        Throws:
        PedDevException