參數 |
類型 |
方向 |
含義 |
cModel |
unsigned char |
IN |
加解密模式選擇: 0->加密 1->解密 |
pkey |
unsigned char * |
IN |
加解密密鑰,8個字節 |
in |
unsigned char * |
IN |
原始數據,8個字節 |
out |
unsigned char * |
OUT |
加解密后的數據,8個字節 |
int stdcall DES(unsigned char cModel, unsigned char *pkey, unsigned char *in, unsigned char *out);
function DES(cModel:Byte;pkey: PChar;InData:PChar;OutData:PChar): Integer;stdcall;external YOWOREADERDLL;
Public Declare Function DES Lib "YW60x.dll" (ByVal cModel As Byte, ByRef pkey As Byte, ByRef InData As Byte, ByRef OutData As Byte) As Long
public int DES(byte cModel, Pointer pkey, Pointer in, Pointer out)
{
int ret;
try
{
JNative fuc = new JNative("YW60x.dll", "DES");
fuc.setRetVal(Type.INT);
fuc.setParameter(0, cModel);
fuc.setParameter(1,pkey);
fuc.setParameter(2,in);
fuc.setParameter(3,out);
fuc.invoke();
ret = fuc.getRetValAsInt();
}
catch(NativeException e)
{
ret = -1;
}
catch(IllegalAccessException e)
{
ret = -2;
}
return ret;
}
[DllImport("YW60x.dll")]
public static extern int DES(byte cModel, byte[] pkey, byte[] inData, byte[] outData);
public FUNCTION long DES(char cModel, ref char pkey[], ref char InData[], ref char OutData[]) library "YW60x.dll"