MIRA
Classes | Typedefs | Functions
Security


For detailed information see Security. More...

Collaboration diagram for Security:

Classes

class  HashDigest
 A generic hash digest, which consists of an array of bytes. More...
 
class  HashStreamBuf
 A generic hash streambuf class. More...
 
class  HashStream< T >
 A template base class for hash functions based on std::ostream. More...
 
class  MD5StreamBuf
 The MD5 hash function. More...
 
class  OpenSSLWrapperMD
 Base class for all message digest hash functions. More...
 
class  RSAKey
 Definition of a RSA key (public or private) More...
 
class  RSASignature
 A class for signing and verifying messages using a RSA key pair. More...
 
class  SHA1StreamBuf
 The SHA1 hash function. More...
 
class  SHA256StreamBuf
 The SHA256 hash function. More...
 

Typedefs

typedef BasicAESEncryptionFilter AESEncryptionFilter
 A AES public encryption filter for boost::iostreams. More...
 
typedef BasicAESDecryptionFilter AESDecryptionFilter
 A AES private decryption filter for boost::iostreams. More...
 
typedef HashStream< MD5StreamBufMD5
 A simple MD5 hash stream. More...
 
typedef BasicRSAPublicEncryptionFilter RSAPublicEncryptionFilter
 A RSA public encryption filter for boost::iostreams. More...
 
typedef BasicRSAPrivateDecryptionFilter RSAPrivateDecryptionFilter
 A RSA private decryption filter for boost::iostreams. More...
 
typedef HashStream< SHA1StreamBufSHA1
 A simple SHA1 hash stream. More...
 
typedef HashStream< SHA256StreamBufSHA256
 A simple SHA256 hash stream. More...
 

Functions

MIRA_BASE_EXPORT std::ostream & operator<< (std::ostream &stream, const RSAKey &key)
 The '<<' operator for RSAKey. More...
 
MIRA_BASE_EXPORT std::istream & operator>> (std::istream &stream, RSAKey &key)
 The '>>' operator for RSAKey. More...
 
MIRA_BASE_EXPORT std::ostream & operator<< (std::ostream &stream, const RSASignature &signature)
 The '<<' operator for RSASignature. More...
 
MIRA_BASE_EXPORT std::istream & operator>> (std::istream &stream, RSASignature &signature)
 The '>>' operator for RSASignature. More...
 

Detailed Description


For detailed information see Security.

Typedef Documentation

◆ AESEncryptionFilter

typedef BasicAESEncryptionFilter AESEncryptionFilter

A AES public encryption filter for boost::iostreams.

Usage example:

AESConfiguration cfg;
cfg.bitLength = AES_256;
cfg.blockCipherMode = AES_CBC;
cfg.salt = "12345678";
boost::iostreams::filtering_ostream tOut;
tOut.push(AESEncryptionFilter(cfg, "Password"));
tOut.push(boost::iostreams::file_sink("AES.dat",
std::ios::out | std::ios::binary));
tOut << "Hello_world!" << endl;

◆ AESDecryptionFilter

typedef BasicAESDecryptionFilter AESDecryptionFilter

A AES private decryption filter for boost::iostreams.

Usage example:

AESConfiguration cfg;
cfg.bitLength = AES_256;
cfg.blockCipherMode = AES_CBC;
cfg.salt = "12345678";
string tMsg;
boost::iostreams::filtering_istream tIn;
tIn.push(AESDecryptionFilter(cfg, "Password"));
tIn.push(boost::iostreams::file_source("AES.dat",
std::ios::in | std::ios::binary));
tIn >> tMsg;

◆ MD5

A simple MD5 hash stream.

◆ RSAPublicEncryptionFilter

typedef BasicRSAPublicEncryptionFilter RSAPublicEncryptionFilter

A RSA public encryption filter for boost::iostreams.

Usage examples:

RSAKey publicKey, privateKey;
RSAKey::generateKey(2048, publicKey, privateKey);
boost::iostreams::filtering_ostream outStream;
outStream.push(RSAPublicEncryptionFilter(publicKey));
outStream.push(boost::iostreams::file_sink("rsa.dat", std::ios::out | std::ios::binary));
outStream << "Hello_world!" << std::endl;
RSAKey publicKey, privateKey;
RSAKey::generateKey(2048, publicKey, privateKey);
std::string inString = "Hello-world!";
std::vector<char> buffer;
boost::iostreams::back_insert_device<std::vector<char>> sink{buffer};
boost::iostreams::filtering_ostream outStream;
outStream.push(RSAPublicEncryptionFilter(publicKey));
outStream.push(sink);
outStream << inString;
outStream.pop();

◆ RSAPrivateDecryptionFilter

typedef BasicRSAPrivateDecryptionFilter RSAPrivateDecryptionFilter

A RSA private decryption filter for boost::iostreams.

Usage examples:

RSAKey publicKey, privateKey;
RSAKey::generateKey(2048, publicKey, privateKey);
std::string inString;
boost::iostreams::filtering_istream inStream;
inStream.push(RSAPrivateDecryptionFilter(privateKey));
inStream.push(boost::iostreams::file_source("rsa.dat", std::ios::in | std::ios::binary));
inStream >> inString;
RSAKey publicKey, privateKey;
RSAKey::generateKey(2048, publicKey, privateKey);
std::string outStr;
boost::iostreams::array_source source{(char*)buffer.data(), buffer.size()};
boost::iostreams::filtering_istream inStream;
inStream.push(RSAPrivateDecryptionFilter(privateKey));
inStream.push(source);
inStream >> outStr;

◆ SHA1

A simple SHA1 hash stream.

◆ SHA256

A simple SHA256 hash stream.

Function Documentation

◆ operator<<() [1/2]

MIRA_BASE_EXPORT std::ostream& mira::operator<< ( std::ostream &  stream,
const RSAKey key 
)

The '<<' operator for RSAKey.

Public keys: "PUBLIC:Len:HexData;"

Private keys: "PRIVATE:Len:HexData;"

◆ operator>>() [1/2]

MIRA_BASE_EXPORT std::istream& mira::operator>> ( std::istream &  stream,
RSAKey key 
)

The '>>' operator for RSAKey.

◆ operator<<() [2/2]

MIRA_BASE_EXPORT std::ostream& mira::operator<< ( std::ostream &  stream,
const RSASignature signature 
)

The '<<' operator for RSASignature.

Format: HexData

◆ operator>>() [2/2]

MIRA_BASE_EXPORT std::istream& mira::operator>> ( std::istream &  stream,
RSASignature signature 
)

The '>>' operator for RSASignature.