001package com.pax.dal;
002import android.content.Context;
003import com.pax.dal.exceptions.WLEKUDevException;
004
005public interface IWLEKUManager {
006
007    public interface WLEKUFormatListener {
008        /**
009         * <div class="zh">格式化结果 </div> <div class="en">Format the result. </div>
010         *
011         * @param code
012         *            <div class="zh">
013         *            <ul>
014         *            <li> 1 格式化成功</li>
015         *            <li>-1 格式化失败</li>
016         *            <li>-2 未找到EKU内存</li>
017         *            <li>-52 验签失败,无权限调用</li>
018         *            <li>100 该设备不支持</li>
019         *            </ul>
020         *            </div> <div class="en"><ul>
021         *            <li> 1 Formatting success </li>
022         *            <li>-1 Formatting failure </li>
023         *            <li>-2 EKU memory not found </li>
024         *            <li>-52 Check failed, no permission to call </li>
025         *            <li>100 The device does not support </li>
026         *            </ul>
027         *            </div>
028         */
029        void onResult(int code);
030    }
031
032    /**
033     * <div class="zh">设置EKU写保护 </div> <div class="en">Set EKU write protection. </div>
034     *
035     * @param type
036     *      <div class="zh"> type = 0,清除写保护,
037     *                       type = 1,临时写保护,重启也能生效
038     *                       type = 3,永久写保护,不能被清除,慎用</div>
039     *      <div class="en"> type = 0: clear write protection.
040     *                       type = 1, write protection is temporary and takes effect after restart
041     *                       type = 3, write protection is permanent and cannot be cleared. Use with caution </div>
042     *
043     * @throws WLEKUDevException
044     *
045     * @since V4.11.00
046     */
047    void setEKUWpType(int type) throws WLEKUDevException;
048
049     /**
050      * <div class="zh">获取EKU写保护状态。</div> <div class="en"> Example Obtain the EKU write protection status </div>
051      *
052      * @return <div class="zh"> 0-没有写保护; 1-临时写保护状态; 3-永久写保护状态; other-无效</div>
053      *         <div class="en">0- No write protection; 1- Temporary write protection status. 3- Permanent write protection status; other- invalid </div>
054      *
055      * @throws WLEKUDevException
056      *
057      * @since V4.11.00
058      */
059     int getEKUWpType() throws WLEKUDevException;
060
061    /**
062     * <div class="zh">格式化EKU内存。</div> <div class="en"> Format the EKU memory </div>
063     *
064     * @param context
065     *            <div class="zh"> 上下文 </div> <div class="en"> contex </div>
066     * @param listener
067     *            <div class="zh">{@link WLEKUFormatListener} </div> <div class="en">{@link WLEKUFormatListener}</div>
068     *
069     * @throws WLEKUDevException
070     *
071     * @since V4.11.00
072     */
073    void formatEKU(Context context,WLEKUFormatListener listener) throws WLEKUDevException;
074
075}