libhomegear-base  0.7
Base library for Homegear and Homegear family modules.
BaseLib::Security::Sign Class Reference

#include <Sign.h>

Public Member Functions

 Sign (const std::string &privateKey, const std::string &publicKey)
 Initializes the GNUTLS key objects. More...
 
 ~Sign ()
 
std::vector< char > sign (const std::vector< char > &data)
 Signs the given data using the private key. More...
 
bool verify (const std::vector< char > &data, const std::vector< char > &signature)
 Verifies the signature of the given data using the public key. More...
 

Constructor & Destructor Documentation

§ Sign()

BaseLib::Security::Sign::Sign ( const std::string &  privateKey,
const std::string &  publicKey 
)

Initializes the GNUTLS key objects.

Parameters
privateKeyThe PEM encoded X509 private key.
publicKeyThe PEM encoced X509 public key.

§ ~Sign()

BaseLib::Security::Sign::~Sign ( )

Member Function Documentation

§ sign()

std::vector< char > BaseLib::Security::Sign::sign ( const std::vector< char > &  data)

Signs the given data using the private key.

Parameters
dataThe data to sign.
Exceptions
SignException
Returns
Returns the signature.

§ verify()

bool BaseLib::Security::Sign::verify ( const std::vector< char > &  data,
const std::vector< char > &  signature 
)

Verifies the signature of the given data using the public key.

Parameters
dataThe data to verify.
signatureThe signature of the data generated using the private key.
Exceptions
SignException
Returns
Returns "true" if the signature is valid and "false" otherwise.

The documentation for this class was generated from the following files: