Hello,
I have successfully added TMS Cryptrography component to the Scripter :
All using RTTI except for all overloaded methods like TAESEncryption.create (on some other methods) which can have 0 to 7 arguments :
with Scripter.DefineClassByRTTI(TAESEncryption) do
begin
DefineMethod('Create',7,tkClass,TAESEncryption,__TAESEncryptionCreate,true,7,'AOwner: TComponent');
DefineMethod('Decrypt',2,tkVariant,nil,__TAESEncryptionDecrypt,false,1,'s: string');
end;
But some methods need uses Tbytes type arguments in Scripter, for example (extracted form TmsCryptography.pdf) :
var
aes: TAESEncryption;
conv: TConvert;
str: string;
b:Tbytes; // <= here
begin
aes:= TAESEncryption.Create;
conv:= TConvert.Create;
try
aes.AType := atcbc;
aes.KeyLength := kl128;
aes.OutputFormat := hexa;
aes.Key := conv.TBytesToString(b); // <= here
aes.IVMode := rand;
aes.PaddingMode := PKCS7;
aes.Unicode := yesUni;
str := AES.Encrypt('test');
Finally
aes.Free;
conv.Free;
end;
end;
That's a bit complicated to handle TBytes in scripter.
Could you provide a code source to handle correctly the TBytes type in scripter ?