Virgil Security Crypto library  2.6.3
Public Member Functions | List of all members
virgil::crypto::pfs::VirgilPFS Class Reference

This is the main entry for the all Perfect Forward Secrecy (PFS) Modules. More...

#include <VirgilPFS.h>

Public Member Functions

 VirgilPFS ()
 Configures PFS module with default underlying algorithms. More...
 
VirgilPFSSession startInitiatorSession (const VirgilPFSInitiatorPrivateInfo &initiatorPrivateInfo, const VirgilPFSResponderPublicInfo &responderPublicInfo, const VirgilByteArray &additionalData=VirgilByteArray())
 Start session from the Initiator side. More...
 
VirgilPFSSession startResponderSession (const VirgilPFSResponderPrivateInfo &responderPrivateInfo, const VirgilPFSInitiatorPublicInfo &initiatorPublicInfo, const VirgilByteArray &additionalData=VirgilByteArray())
 Start session from the Responder side. More...
 
VirgilPFSEncryptedMessage encrypt (const VirgilByteArray &data)
 Encrypt given data. More...
 
VirgilByteArray decrypt (const VirgilPFSEncryptedMessage &encryptedMessage) const
 Decrypt given message. More...
 
void setRandom (VirgilOperationRandom random)
 Set custom implementation for algorithm: random. More...
 
void setDH (VirgilOperationDH dh)
 Set custom implementation for algorithm: Diffie–Hellman. More...
 
void setKDF (VirgilOperationKDF kdf)
 Set custom implementation for algorithm: Key Dervation Function. More...
 
void setCipher (VirgilOperationCipher cipher)
 Set custom implementation for algorithm: Symmetric Cipher. More...
 
VirgilPFSSession getSession () const
 Return current session. More...
 
void setSession (VirgilPFSSession session)
 Set new session. More...
 

Detailed Description

This is the main entry for the all Perfect Forward Secrecy (PFS) Modules.

Constructor & Destructor Documentation

virgil::crypto::pfs::VirgilPFS::VirgilPFS ( )

Configures PFS module with default underlying algorithms.

Each underlying algorithm can be changed with correspond setter.

Member Function Documentation

VirgilByteArray virgil::crypto::pfs::VirgilPFS::decrypt ( const VirgilPFSEncryptedMessage encryptedMessage) const

Decrypt given message.

Parameters
encryptedMessage- message to be decrypted.
Returns
Plain text.
Note
Stored session is used for decryption.
VirgilPFSEncryptedMessage virgil::crypto::pfs::VirgilPFS::encrypt ( const VirgilByteArray data)

Encrypt given data.

Parameters
data- data to be encrypted.
Returns
Encrypted message.
Note
Stored session is used for encryption.
Function has side effect: random_ internal state is changed.
VirgilPFSSession virgil::crypto::pfs::VirgilPFS::getSession ( ) const

Return current session.

Returns
Session.
void virgil::crypto::pfs::VirgilPFS::setCipher ( VirgilOperationCipher  cipher)

Set custom implementation for algorithm: Symmetric Cipher.

Parameters
cipher- new algorithm implementation.
void virgil::crypto::pfs::VirgilPFS::setDH ( VirgilOperationDH  dh)

Set custom implementation for algorithm: Diffie–Hellman.

Parameters
dh- new algorithm implementation.
void virgil::crypto::pfs::VirgilPFS::setKDF ( VirgilOperationKDF  kdf)

Set custom implementation for algorithm: Key Dervation Function.

Parameters
kdf- new algorithm implementation.
void virgil::crypto::pfs::VirgilPFS::setRandom ( VirgilOperationRandom  random)

Set custom implementation for algorithm: random.

Parameters
random- new algorithm implementation.
void virgil::crypto::pfs::VirgilPFS::setSession ( VirgilPFSSession  session)

Set new session.

Parameters
session- new session.
VirgilPFSSession virgil::crypto::pfs::VirgilPFS::startInitiatorSession ( const VirgilPFSInitiatorPrivateInfo initiatorPrivateInfo,
const VirgilPFSResponderPublicInfo responderPublicInfo,
const VirgilByteArray additionalData = VirgilByteArray() 
)

Start session from the Initiator side.

Parameters
initiatorPrivateInfo- initiator private keys and related information.
responderPublicInfo- responder public keys and related information.
additionalData- any identifying information about Initiator and/or Responder.
Returns
Created session (can be ignored).
Note
Function has side effect: created session is stored in the object state.
VirgilPFSSession virgil::crypto::pfs::VirgilPFS::startResponderSession ( const VirgilPFSResponderPrivateInfo responderPrivateInfo,
const VirgilPFSInitiatorPublicInfo initiatorPublicInfo,
const VirgilByteArray additionalData = VirgilByteArray() 
)

Start session from the Responder side.

Parameters
responderPrivateInfo- responder private keys and related information.
initiatorPublicInfo- initiator public keys and related information.
additionalData- any identifying information about Initiator and/or Responder.
Returns
Created session (can be ignored).
Note
Function has side effect: created session is stored in the object state.

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