C++ native API for Viafirma

Althrough we already have support for .NET, Java and PHP, has been necessary to implement a native client for c++ for integration into an importan project of the banking sector.

You can download it from: http://code.google.com/p/viafirma-client-cpp/

// Configuration
std::string urlViafirma(“http://services.viafirma.com/viafirma”);

// create instance of Viafirma client (dont share between threads)
viafirmaClient v(urlViafirma);

// Call to server
std::cout << “TEST Sign method. Id sign:”<<result;
std::cout<<“nYou can see the verification info in:n “<<urlViafirma<<“/v/”+result;

// get signed Document (CMD/PKCS7 format)

std::string idSign=result;
SignedDocument info=v.getSignedDocument(idSign);
// Signed Document Data: CMD/PKCS7 data: info.data;
std::cout<<“n id:”<<info.id;
std::cout<<“n name Document:”<<info.name;
std::cout<<“n typeFile:”<<info.typeFile;
std::cout<<“n Type Format Sign:”<<info.typeFormatSign;
std::cout<<“n Signed Document size:”<<info.data;
std::cout<<“n Signed Document size:”<<sizeof(info.data);

Deja un comentario