CryptoByLeo/Src/Padding/PKCS1v15/Test.mq5
2026-08-21 07:35:21 -05:00

37 lines
No EOL
1.4 KiB
MQL5

//+------------------------------------------------------------------+
//| Test.mq5 |
//| Copyright 2026, Niquel Mendoza |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2026, Niquel Mendoza"
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
#include "Main.mqh"
#include <TSN\\BInt\\NUtils.mqh>
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
//---
uchar msg[];
string str_mes = "Este es un mensaje";
StringToCharArray(str_mes, msg, 0, StringLen(str_mes));
//---
uchar out[];
const int t = TSN::CPKCS1v15::FirmarEncode(msg, 256, TSN::CCryptoHashMeta::TSN_CRYPTO_HASH_TYPE_SHA256, out);
//---
string str = "";
Print(t);
TSN::CNumberUtils::BytesToHexLower(out, t, str);
Print(str);
}
//+------------------------------------------------------------------+