Virgil Security Crypto library  2.0.7
Namespaces | Classes | Typedefs | Enumerations | Functions
virgil::crypto Namespace Reference

This namespace contains interfaces for high-level crypto operations, i.e. generate key pair, encrypt and decrypt data, sign and verify data. More...

Namespaces

 foundation
 This namespace contains interfaces for low-level crypto operations.
 
 stream
 This namespace contains interfaces for stream data processing in crypto algorithms.
 

Classes

class  VirgilByteArrayUtils
 This class contains conversion utils for byte sequence. More...
 
class  VirgilChunkCipher
 This class provides high-level interface to encrypt / decrypt data splitted to chunks. More...
 
class  VirgilCipher
 This class provides high-level interface to encrypt / decrypt data using Virgil Security keys. More...
 
class  VirgilCipherBase
 This class provides configuration methods to all Virgil*Cipher classes. More...
 
class  VirgilCryptoErrorCategory
 This is specific error category that contains information about crypto library errors. More...
 
class  VirgilCryptoException
 This only exception that crypto library can produce. More...
 
class  VirgilCustomParams
 Data object that represent ASN.1 structure: VirgilCustomParams. More...
 
class  VirgilDataSink
 This is base class for output streams. More...
 
class  VirgilDataSource
 This is base class for input streams. More...
 
class  VirgilKeyPair
 This class handles information about Virgil Security key pair. More...
 
class  VirgilSigner
 This class provides high-level interface to sign and verify data using Virgil Security keys. More...
 
class  VirgilStreamCipher
 This class provides high-level interface to encrypt / decrypt streaming data using Virgil Security keys. More...
 
class  VirgilStreamSigner
 This class provides high-level interface to sign and verify data using Virgil Security keys. More...
 
class  VirgilTinyCipher
 This class aim is to minimize encryption output. More...
 
class  VirgilVersion
 Provides information about Virgil library version. More...
 

Typedefs

typedef std::vector< unsigned char > VirgilByteArray
 This type represents a sequence of bytes.
 

Enumerations

enum  VirgilCryptoError {
  VirgilCryptoError::Reserved = 0, VirgilCryptoError::EmptyParameter, VirgilCryptoError::ExceededMaxSize, VirgilCryptoError::InvalidArgument,
  VirgilCryptoError::InvalidFormat, VirgilCryptoError::InvalidPrivateKey, VirgilCryptoError::InvalidPrivateKeyPassword, VirgilCryptoError::InvalidPublicKey,
  VirgilCryptoError::InvalidSignature, VirgilCryptoError::InvalidState, VirgilCryptoError::InvalidAuth, VirgilCryptoError::MismatchSignature,
  VirgilCryptoError::NotFoundKeyRecipient, VirgilCryptoError::NotFoundPasswordRecipient, VirgilCryptoError::NotInitialized, VirgilCryptoError::NotSecure,
  VirgilCryptoError::UnsupportedAlgorithm, Undefined = std::numeric_limits<int>::max()
}
 Specific error codes for the crypto library. More...
 

Functions

VirgilByteArray str2bytes (const std::string &str)
 Represents given string as byte array.
 
std::string bytes2str (const VirgilByteArray &array)
 Represent given byte array as string.
 
VirgilByteArray hex2bytes (const std::string hexStr)
 Translate given HEX string to the byte array. More...
 
std::string bytes2hex (const VirgilByteArray &array, bool formatted=false)
 Translate given byte array to the HEX string. More...
 
const VirgilCryptoErrorCategorycrypto_category () noexcept
 Return singleton instance of the crypto error category. More...
 
VirgilCryptoException make_error (VirgilCryptoError ev)
 Build exception with given error value and corresond error category. More...
 
VirgilCryptoException make_error (VirgilCryptoError ev, const std::string &what)
 Build exception with given error value and corresond error category. More...
 
VirgilCryptoException make_error (VirgilCryptoError ev, const char *what)
 Build exception with given error value and corresond error category. More...
 
std::string backtrace_exception (const std::exception &exception, size_t level=0)
 Unwind information about nested excpetions. More...
 
ByteArray security clear utilities
void bytes_zeroize (VirgilByteArray &array)
 Make all bytes zero.
 
void string_zeroize (std::string &str)
 Make all chars zero.
 

Detailed Description

This namespace contains interfaces for high-level crypto operations, i.e. generate key pair, encrypt and decrypt data, sign and verify data.

Function Documentation

std::string virgil::crypto::backtrace_exception ( const std::exception &  exception,
size_t  level = 0 
)

Unwind information about nested excpetions.

Parameters
exception- Top level exception.
level- initial identation level.
Returns
Formatted message of top level exception and all nested exceptions.
std::string virgil::crypto::bytes2hex ( const VirgilByteArray array,
bool  formatted = false 
)
inline

Translate given byte array to the HEX string.

Parameters
array- byte array.
formatted- if true, endline will be inserted every 16 bytes, and all bytes will be separated with whitespaces.
Returns
HEX string.
VirgilByteArray virgil::crypto::hex2bytes ( const std::string  hexStr)
inline

Translate given HEX string to the byte array.

Parameters
hexStr- HEX string.
Returns
Byte array.