#include <epasscrypto.hpp>
|
| EPassCrypto () |
|
| EPassCrypto (const std::string &mrz) |
|
void | reset (const std::string &mrz) |
|
void | compute_session_keys (const ByteVector &k_icc, const ByteVector &random_icc) override |
|
ByteVector | compute_enc_key (const ByteVector &seed, const std::string hash_algo="sha1", unsigned char keylen=16) |
|
ByteVector | compute_mac_key (const ByteVector &seed, const std::string hash_algo="sha1", unsigned char keylen=16) |
|
ByteVector | compute_mac (std::shared_ptr< openssl::SymmetricCipher > cipher, const ByteVector &in, const ByteVector &k_mac, const ByteVector &iv={}, const ByteVector &ssc={}) override |
|
| 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 |
|
◆ EPassCrypto() [1/2]
EPassCrypto::EPassCrypto |
( |
| ) |
|
|
explicit |
◆ EPassCrypto() [2/2]
EPassCrypto::EPassCrypto |
( |
const std::string & |
mrz | ) |
|
|
explicit |
◆ adjust_key_parity()
◆ compute_enc_key()
ByteVector EPassCrypto::compute_enc_key |
( |
const ByteVector & |
seed, |
|
|
const std::string |
hash_algo = "sha1" , |
|
|
unsigned char |
keylen = 16 |
|
) |
| |
◆ compute_mac()
ISO 9797-1 MAC Algorithm 3
Perform MAC computation on the block in
.
The computation requires k_mac
, a 16bytes key that will be split in two during the computation.
Unless the MAC computation is for the Mutual Authenticate command, SSC (Send Session Counter) is required, otherwise the MAC will be rejected.
- Warning
- No padding is performed.
Implements logicalaccess::ISO24727Crypto.
◆ compute_mac_key()
ByteVector EPassCrypto::compute_mac_key |
( |
const ByteVector & |
seed, |
|
|
const std::string |
hash_algo = "sha1" , |
|
|
unsigned char |
keylen = 16 |
|
) |
| |
◆ compute_session_keys()
◆ reset()
void EPassCrypto::reset |
( |
const std::string & |
mrz | ) |
|
The documentation for this class was generated from the following files:
- C:/dev/lla/liblogicalaccess/plugins/logicalaccess/plugins/cards/epass/epasscrypto.hpp
- C:/dev/lla/liblogicalaccess/plugins/logicalaccess/plugins/cards/epass/epasscrypto.cpp