#include <iso24727crypto.hpp>
|
| ISO24727Crypto (const std::string &cipher="3des", const std::string &hash="sha1") |
|
ByteVector | step1 (const ByteVector &random_icc, ByteVector random_ifd={}, ByteVector random_k_ifd={}) |
|
bool | step2 (const ByteVector &auth_response) |
|
bool | secureMode () const |
|
ByteVector | encrypt_apdu (const ByteVector &apdu) |
|
ByteVector | decrypt_rapdu (const ByteVector &rapdu) |
|
ByteVector | encrypt_apdu (std::shared_ptr< openssl::SymmetricCipher > cipher, const ByteVector &apdu, const ByteVector &ks_enc, const ByteVector &ks_mac, const ByteVector &ssc) |
|
ByteVector | decrypt_rapdu (std::shared_ptr< openssl::SymmetricCipher > cipher, const ByteVector &rapdu, const ByteVector &ks_enc, const ByteVector &ks_mac, const ByteVector &ssc) |
|
ByteVector | get_session_enc_key () const |
|
ByteVector | get_session_mac_key () const |
|
ByteVector | get_send_session_counter () const |
|
virtual ByteVector | auth_pad (const ByteVector &data) |
|
virtual void | compute_session_keys (const ByteVector &k_icc, const ByteVector &random_icc)=0 |
|
virtual ByteVector | compute_mac (std::shared_ptr< openssl::SymmetricCipher > cipher, const ByteVector &in, const ByteVector &k_mac, const ByteVector &iv={}, const ByteVector &scc={})=0 |
|
virtual void | reset () |
|
std::shared_ptr< openssl::SymmetricCipher > | createCipher () const |
|
◆ ISO24727Crypto()
ISO24727Crypto::ISO24727Crypto |
( |
const std::string & |
cipher = "3des" , |
|
|
const std::string & |
hash = "sha1" |
|
) |
| |
|
explicit |
◆ auth_pad()
◆ compute_mac()
◆ compute_session_keys()
virtual void logicalaccess::ISO24727Crypto::compute_session_keys |
( |
const ByteVector & |
k_icc, |
|
|
const ByteVector & |
random_icc |
|
) |
| |
|
pure virtual |
◆ createCipher()
◆ decrypt_rapdu() [1/2]
◆ decrypt_rapdu() [2/2]
◆ encrypt_apdu() [1/2]
◆ encrypt_apdu() [2/2]
◆ get_send_session_counter()
ByteVector ISO24727Crypto::get_send_session_counter |
( |
| ) |
const |
◆ get_session_enc_key()
ByteVector ISO24727Crypto::get_session_enc_key |
( |
| ) |
const |
◆ get_session_mac_key()
ByteVector ISO24727Crypto::get_session_mac_key |
( |
| ) |
const |
◆ hash_data()
ByteVector ISO24727Crypto::hash_data |
( |
const ByteVector & |
data, |
|
|
const std::string |
hash_algo = "sha1" |
|
) |
| |
|
static |
◆ increment_ssc()
Increment the Session Send Counter by one and return a new ByteVector.
◆ pad()
ISO 9797-1 padding method 2
◆ reset()
void ISO24727Crypto::reset |
( |
| ) |
|
|
virtual |
◆ secureMode()
bool ISO24727Crypto::secureMode |
( |
| ) |
const |
Are we currently already in a Secure Messaging session ?
◆ step1()
Call after construction to feed the random from the card to the crypto helper.
The random_ifd and random_k_ifd array will be generated if left to they default, empty value. Specifying this parameter is useful for testing purpose or if you make use of a custom source of randomness.
- Returns
- Command data for Mutual Authenticate.
◆ step2()
bool ISO24727Crypto::step2 |
( |
const ByteVector & |
auth_response | ) |
|
Process the response from the ICC.
If step2() completes successfully, the user is allowed to call the various get_*() method.
◆ unpad()
Cancel the padding created by pad()
◆ cipher_
std::string logicalaccess::ISO24727Crypto::cipher_ |
|
protected |
◆ hash_
std::string logicalaccess::ISO24727Crypto::hash_ |
|
protected |
◆ k_enc_
◆ k_mac_
◆ random_ifd_
ByteVector logicalaccess::ISO24727Crypto::random_ifd_ |
|
protected |
Generated at step1 (or inputted at step1).
◆ random_k_ifd_
ByteVector logicalaccess::ISO24727Crypto::random_k_ifd_ |
|
protected |
Generated at step1 (or inputted at step1).
◆ S_enc_
◆ S_mac_
◆ S_send_counter_
ByteVector logicalaccess::ISO24727Crypto::S_send_counter_ |
|
protected |
◆ step2_success_
bool logicalaccess::ISO24727Crypto::step2_success_ |
|
protected |
The documentation for this class was generated from the following files: