com.gen2wave.rp1600.sdk.finger

## Class OTG_KEY

- java.lang.Object
- - com.gen2wave.rp1600.sdk.finger.OTG_KEY

-     public class OTG_KEY
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static byte` | `BURN_CODE`
    `static int` | `CMD`
    `static byte` | `DATA`
    `static int` | `DEV_ADDR`
    `static int` | `DEVICE_BUFFER_TOO_SMALL`
    `static int` | `DEVICE_CONTAINER_TOOMORE`
    `static int` | `DEVICE_ERR_CREATEFILE`
    `static int` | `DEVICE_ERR_EXISTFILE`
    `static int` | `DEVICE_ERR_FUNCTION_NOT_SUPPORT`
    `static int` | `DEVICE_ERR_GETEKEYPARAM`
    `static int` | `DEVICE_ERR_NOFILE`
    `static int` | `DEVICE_ERR_OPENFILE`
    `static int` | `DEVICE_ERR_PARAMETER_NOT_SUPPORT`
    `static int` | `DEVICE_ERR_PINLOCKED`
    `static int` | `DEVICE_ERR_READFILE`
    `static int` | `DEVICE_ERR_WRITEFILE`
    `static int` | `DEVICE_FAILED`
    `static int` | `DEVICE_INVALID_PARAMETER`
    `static int` | `DEVICE_KEY_INVALID`
    `static int` | `DEVICE_KEY_REMOVED`
    `static int` | `DEVICE_SUCCESS`
    `static int` | `DEVICE_USER_NOT_LOG_IN`
    `static int` | `DEVICE_VERIFIEDPIN_FAILED`
    `static byte` | `DOWN_CHAR`
    `static byte` | `EMPTY`
    `static byte` | `ENDDATA`
    `static byte` | `GEN_CHAR`
    `static byte` | `GET_IMAGE`
    `static int` | `HEAD_LENGTH`
    `static int` | `IMAGE_X`
    `static int` | `IMAGE_Y`
    `static byte` | `LOAD_CHAR`
    `static int` | `MAX_PACKAGE_SIZE`
    `byte[]` | `myprintf`
    `static byte` | `READ_INDEXTABLE`
    `static byte` | `READ_NOTEPAD`
    `static byte` | `REG_MODULE`
    `static byte` | `RESPONSE`
    `static byte` | `SEARCH`
    `static byte` | `STORE_CHAR`
    `static int` | `TYPE_ALG_RSA_1024`
    `static int` | `TYPE_ALG_SHA_1`
    `static int` | `TYPE_ALG_SHA_256`
    `static int` | `TYPE_ALG_SM2_256`
    `static int` | `TYPE_ALG_SM3`
    `static int` | `TYPE_KEY_ENCRYPT`
    `static int` | `TYPE_KEY_SIGN`
    `static byte` | `UP_CHAR`
    `static byte` | `UP_IMAGE`
    `static byte` | `VFY_PWD`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `OTG_KEY(UsbManager mManager, UsbDevice mDev)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `AdminLogin(java.lang.String userPin)`
    `boolean` | `AdminModifyUserPin(java.lang.String oldUserPin, java.lang.String newUserPin)`
    `static java.lang.String` | `bytesToHexString(byte[] bArray)`
    `boolean` | `CleanFlag()`
    `int` | `CloseCard(int hKey)`
    `int` | `DeCodeUSB(byte[] source, int sourceLen, byte[] destination, int[] destinationLength)`
    `int` | `Delock(java.lang.String adminPin, java.lang.String userPin)`
    `int` | `downChar(int iBufferID, byte[] pTemplet, int iTempletLength)`
    `int` | `EnCode(int addr, byte[] source, int sourceLen, byte[] destination, int[] destinationLength)`
    `byte[]` | `exportCertificate(java.lang.String containerName, int keyType)`
    `int` | `fillPackage_new(byte[] pData, int packageType, int length, byte[] pContent)`
    `int` | `fillPackage(byte[] pData, int packageType, int length, byte[] pContent)`
    `int` | `generateKeyPair(java.lang.String containerName, int algType)`
    `byte[]` | `genRandom(int randomLen)`
    `int` | `GetPackageCharUDisk(byte[] data)`
    `int` | `GetPackageImageUDisk(byte[] data, int Imagelen)`
    `int` | `GetPackageLength(byte[] data)`
    `int` | `GetPackageUDisk(byte[] data)`
    `int` | `GetPackageUDiskSearch(byte[] data)`
    `boolean` | `importCertificate(java.lang.String containerName, int keyType, byte[] cert)`
    `boolean` | `initDevice(java.lang.String superPin, java.lang.String adminPin, java.lang.String userPin, int retryNum)`
    `int` | `loadChar(int iBufferID, int pageNum)`
    `boolean` | `logout()`
    `boolean` | `modifyUserPin(java.lang.String oldUserPin, java.lang.String newUserPin)`
    `boolean` | `openContainerState(java.lang.String containerName)`
    `int` | `OpenUKey()`
    `int` | `PSClearFlag(int addr)`
    `int` | `PSEmpty(int addr)`
    `int` | `PSGenChar(int addr, int bufferID)`
    `int` | `PSGetImage(int addr)`
    `int` | `PSOpen()`
    `int` | `PSReadIndexTable(int addr, int nPage, byte[] UserContent)`
    `int` | `PSReadInfo(int addr, int page, byte[] userContent)`
    `int` | `PSRegModule(int addr)`
    `int` | `PSSearch(int addr, int bufferID, int startPage, int pageNum, int[] mbAddr)`
    `int` | `PSStoreChar(int addr, int bufferID, int pageID)`
    `int` | `PSUpImage(int addr, byte[] pImageData)`
    `int` | `PSVfyPwd(int nAddr, byte[] passWord)`
    `int` | `PSword()`
    `int` | `SendPackageUDisk(int addr, byte[] data)`
    `byte[]` | `signData(java.lang.String containerName, int keyType, int hashType, byte[] inData, byte[] getSignSendData, int[] getSignSendLen)`
    `int` | `storeChar(int bufferId, int pageId)`
    `java.lang.String` | `synoprintf()`
    `int` | `upChar(int iBufferID, byte[] pTemplet, int iTempletLength)`
    `int` | `upData2Temp(byte[] in, byte[] out)`
    `int` | `UsbOpen()`
    `int` | `UserLogin(java.lang.String userPin)`
    `int` | `VerifyResponsePackage(byte packageTypt, byte[] data)`
    `boolean` | `verifySignedData(byte[] cert, byte[] inData, byte[] signedValue, int hashType)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### TYPE_ALG_RSA_1024

          public static final int TYPE_ALG_RSA_1024

      See Also:
        Constant Field Values

    - #### TYPE_ALG_SM2_256

          public static final int TYPE_ALG_SM2_256

      See Also:
        Constant Field Values

    - #### TYPE_ALG_SHA_1

          public static final int TYPE_ALG_SHA_1

      See Also:
        Constant Field Values

    - #### TYPE_ALG_SHA_256

          public static final int TYPE_ALG_SHA_256

      See Also:
        Constant Field Values

    - #### TYPE_ALG_SM3

          public static final int TYPE_ALG_SM3

      See Also:
        Constant Field Values

    - #### TYPE_KEY_ENCRYPT

          public static final int TYPE_KEY_ENCRYPT

      See Also:
        Constant Field Values

    - #### TYPE_KEY_SIGN

          public static final int TYPE_KEY_SIGN

      See Also:
        Constant Field Values

    - #### MAX_PACKAGE_SIZE

          public static final int MAX_PACKAGE_SIZE

      See Also:
        Constant Field Values

    - #### CMD

          public static final int CMD

      See Also:
        Constant Field Values

    - #### DATA

          public static final byte DATA

      See Also:
        Constant Field Values

    - #### ENDDATA

          public static final byte ENDDATA

      See Also:
        Constant Field Values

    - #### VFY_PWD

          public static final byte VFY_PWD

      See Also:
        Constant Field Values

    - #### RESPONSE

          public static final byte RESPONSE

      See Also:
        Constant Field Values

    - #### GET_IMAGE

          public static final byte GET_IMAGE

      See Also:
        Constant Field Values

    - #### READ_NOTEPAD

          public static final byte READ_NOTEPAD

      See Also:
        Constant Field Values

    - #### HEAD_LENGTH

          public static final int HEAD_LENGTH

      See Also:
        Constant Field Values

    - #### GEN_CHAR

          public static final byte GEN_CHAR

      See Also:
        Constant Field Values

    - #### REG_MODULE

          public static final byte REG_MODULE

      See Also:
        Constant Field Values

    - #### STORE_CHAR

          public static final byte STORE_CHAR

      See Also:
        Constant Field Values

    - #### LOAD_CHAR

          public static final byte LOAD_CHAR

      See Also:
        Constant Field Values

    - #### BURN_CODE

          public static final byte BURN_CODE

      See Also:
        Constant Field Values

    - #### UP_CHAR

          public static final byte UP_CHAR

      See Also:
        Constant Field Values

    - #### DOWN_CHAR

          public static final byte DOWN_CHAR

      See Also:
        Constant Field Values

    - #### SEARCH

          public static final byte SEARCH

      See Also:
        Constant Field Values

    - #### DEV_ADDR

          public static final int DEV_ADDR

      See Also:
        Constant Field Values

    - #### EMPTY

          public static final byte EMPTY

      See Also:
        Constant Field Values

    - #### READ_INDEXTABLE

          public static final byte READ_INDEXTABLE

      See Also:
        Constant Field Values

    - #### UP_IMAGE

          public static final byte UP_IMAGE

      See Also:
        Constant Field Values

    - #### IMAGE_X

          public static final int IMAGE_X

      See Also:
        Constant Field Values

    - #### IMAGE_Y

          public static final int IMAGE_Y

      See Also:
        Constant Field Values

    - #### DEVICE_SUCCESS

          public static final int DEVICE_SUCCESS

      See Also:
        Constant Field Values

    - #### DEVICE_FAILED

          public static final int DEVICE_FAILED

      See Also:
        Constant Field Values

    - #### DEVICE_KEY_REMOVED

          public static final int DEVICE_KEY_REMOVED

      See Also:
        Constant Field Values

    - #### DEVICE_KEY_INVALID

          public static final int DEVICE_KEY_INVALID

      See Also:
        Constant Field Values

    - #### DEVICE_INVALID_PARAMETER

          public static final int DEVICE_INVALID_PARAMETER

      See Also:
        Constant Field Values

    - #### DEVICE_VERIFIEDPIN_FAILED

          public static final int DEVICE_VERIFIEDPIN_FAILED

      See Also:
        Constant Field Values

    - #### DEVICE_USER_NOT_LOG_IN

          public static final int DEVICE_USER_NOT_LOG_IN

      See Also:
        Constant Field Values

    - #### DEVICE_BUFFER_TOO_SMALL

          public static final int DEVICE_BUFFER_TOO_SMALL

      See Also:
        Constant Field Values

    - #### DEVICE_CONTAINER_TOOMORE

          public static final int DEVICE_CONTAINER_TOOMORE

      See Also:
        Constant Field Values

    - #### DEVICE_ERR_GETEKEYPARAM

          public static final int DEVICE_ERR_GETEKEYPARAM

      See Also:
        Constant Field Values

    - #### DEVICE_ERR_PINLOCKED

          public static final int DEVICE_ERR_PINLOCKED

      See Also:
        Constant Field Values

    - #### DEVICE_ERR_CREATEFILE

          public static final int DEVICE_ERR_CREATEFILE

      See Also:
        Constant Field Values

    - #### DEVICE_ERR_EXISTFILE

          public static final int DEVICE_ERR_EXISTFILE

      See Also:
        Constant Field Values

    - #### DEVICE_ERR_OPENFILE

          public static final int DEVICE_ERR_OPENFILE

      See Also:
        Constant Field Values

    - #### DEVICE_ERR_READFILE

          public static final int DEVICE_ERR_READFILE

      See Also:
        Constant Field Values

    - #### DEVICE_ERR_WRITEFILE

          public static final int DEVICE_ERR_WRITEFILE

      See Also:
        Constant Field Values

    - #### DEVICE_ERR_NOFILE

          public static final int DEVICE_ERR_NOFILE

      See Also:
        Constant Field Values

    - #### DEVICE_ERR_PARAMETER_NOT_SUPPORT

          public static final int DEVICE_ERR_PARAMETER_NOT_SUPPORT

      See Also:
        Constant Field Values

    - #### DEVICE_ERR_FUNCTION_NOT_SUPPORT

          public static final int DEVICE_ERR_FUNCTION_NOT_SUPPORT

      See Also:
        Constant Field Values

    - #### myprintf

          public byte[] myprintf

  - ### Constructor Detail

    - #### OTG_KEY

          public OTG_KEY(UsbManager mManager,
                         UsbDevice mDev)

  - ### Method Detail

    - #### UsbOpen

          public int UsbOpen()

    - #### OpenUKey

          public int OpenUKey()

    - #### CloseCard

          public int CloseCard(int hKey)

    - #### UserLogin

          public int UserLogin(java.lang.String userPin)

    - #### AdminLogin

          public int AdminLogin(java.lang.String userPin)

    - #### Delock

          public int Delock(java.lang.String adminPin,
                            java.lang.String userPin)

    - #### logout

          public boolean logout()

    - #### CleanFlag

          public boolean CleanFlag()

    - #### modifyUserPin

          public boolean modifyUserPin(java.lang.String oldUserPin,
                                       java.lang.String newUserPin)

    - #### AdminModifyUserPin

          public boolean AdminModifyUserPin(java.lang.String oldUserPin,
                                            java.lang.String newUserPin)

    - #### genRandom

          public byte[] genRandom(int randomLen)

    - #### generateKeyPair

          public int generateKeyPair(java.lang.String containerName,
                                     int algType)

    - #### signData

          public byte[] signData(java.lang.String containerName,
                                 int keyType,
                                 int hashType,
                                 byte[] inData,
                                 byte[] getSignSendData,
                                 int[] getSignSendLen)

    - #### verifySignedData

          public boolean verifySignedData(byte[] cert,
                                          byte[] inData,
                                          byte[] signedValue,
                                          int hashType)

    - #### importCertificate

          public boolean importCertificate(java.lang.String containerName,
                                           int keyType,
                                           byte[] cert)

    - #### exportCertificate

          public byte[] exportCertificate(java.lang.String containerName,
                                          int keyType)

    - #### openContainerState

          public boolean openContainerState(java.lang.String containerName)

    - #### initDevice

          public boolean initDevice(java.lang.String superPin,
                                    java.lang.String adminPin,
                                    java.lang.String userPin,
                                    int retryNum)

    - #### fillPackage

          public int fillPackage(byte[] pData,
                                 int packageType,
                                 int length,
                                 byte[] pContent)

    - #### fillPackage_new

          public int fillPackage_new(byte[] pData,
                                     int packageType,
                                     int length,
                                     byte[] pContent)

    - #### DeCodeUSB

          public int DeCodeUSB(byte[] source,
                               int sourceLen,
                               byte[] destination,
                               int[] destinationLength)

    - #### EnCode

          public int EnCode(int addr,
                            byte[] source,
                            int sourceLen,
                            byte[] destination,
                            int[] destinationLength)

    - #### VerifyResponsePackage

          public int VerifyResponsePackage(byte packageTypt,
                                           byte[] data)

    - #### GetPackageLength

          public int GetPackageLength(byte[] data)

    - #### SendPackageUDisk

          public int SendPackageUDisk(int addr,
                                      byte[] data)

    - #### GetPackageUDisk

          public int GetPackageUDisk(byte[] data)

    - #### GetPackageUDiskSearch

          public int GetPackageUDiskSearch(byte[] data)

    - #### GetPackageCharUDisk

          public int GetPackageCharUDisk(byte[] data)

    - #### GetPackageImageUDisk

          public int GetPackageImageUDisk(byte[] data,
                                          int Imagelen)

    - #### PSVfyPwd

          public int PSVfyPwd(int nAddr,
                              byte[] passWord)

    - #### PSGetImage

          public int PSGetImage(int addr)

    - #### PSClearFlag

          public int PSClearFlag(int addr)

    - #### PSReadInfo

          public int PSReadInfo(int addr,
                                int page,
                                byte[] userContent)

    - #### PSGenChar

          public int PSGenChar(int addr,
                               int bufferID)

    - #### PSRegModule

          public int PSRegModule(int addr)

    - #### PSStoreChar

          public int PSStoreChar(int addr,
                                 int bufferID,
                                 int pageID)

    - #### PSSearch

          public int PSSearch(int addr,
                              int bufferID,
                              int startPage,
                              int pageNum,
                              int[] mbAddr)

    - #### PSOpen

          public int PSOpen()

    - #### PSEmpty

          public int PSEmpty(int addr)

    - #### PSword

          public int PSword()

    - #### PSReadIndexTable

          public int PSReadIndexTable(int addr,
                                      int nPage,
                                      byte[] UserContent)

    - #### PSUpImage

          public int PSUpImage(int addr,
                               byte[] pImageData)

    - #### upData2Temp

          public int upData2Temp(byte[] in,
                                 byte[] out)

    - #### upChar

          public int upChar(int iBufferID,
                            byte[] pTemplet,
                            int iTempletLength)

    - #### bytesToHexString

          public static final java.lang.String bytesToHexString(byte[] bArray)

    - #### loadChar

          public int loadChar(int iBufferID,
                              int pageNum)

    - #### downChar

          public int downChar(int iBufferID,
                              byte[] pTemplet,
                              int iTempletLength)

    - #### storeChar

          public int storeChar(int bufferId,
                               int pageId)
                        throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### synoprintf

          public java.lang.String synoprintf()