C++ native API for Viafirma

27 Dec 2010

Compartelo:Share on Facebook0Share on Google+0Tweet about this on TwitterShare on LinkedIn0

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/

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

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

// Call to server
result=v.signByServer(nameFile,dataToSign,dataSize,alias,password,TYPE_FILE_BINARRY,TYPE_FORMAT_SIGN_BINARRY);
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);
[/code]

Compartelo:Share on Facebook0Share on Google+0Tweet about this on TwitterShare on LinkedIn0

No Comments

Leave a Reply

*