![]() |
GNSS-SDR 0.0.21
An Open Source GNSS Software Defined Receiver
|
Class implementing cryptographic functions for Navigation Message Authentication. More...
#include <gnss_crypto.h>
Public Member Functions | |
| Gnss_Crypto () | |
| Default constructor. | |
| Gnss_Crypto (const std::string &certFilePath, const std::string &merkleTreePath) | |
| ~Gnss_Crypto () | |
| Default destructor. | |
| bool | have_public_key () const |
| Returns true if the ECDSA Public Key is already loaded. | |
| bool | store_public_key (const std::string &pubKeyFilePath) const |
| bool | verify_signature_ecdsa_p256 (const std::vector< uint8_t > &message, const std::vector< uint8_t > &signature) const |
| Verify ECDSA-P256 signature (message in plain hex, signature in raw format). | |
| bool | verify_signature_ecdsa_p521 (const std::vector< uint8_t > &message, const std::vector< uint8_t > &signature) const |
| Verify ECDSA-P521 signature (message in plain hex, signature in raw format). | |
| std::vector< uint8_t > | compute_SHA_256 (const std::vector< uint8_t > &input) const |
| Computes SHA-256 hash. | |
| std::vector< uint8_t > | compute_SHA3_256 (const std::vector< uint8_t > &input) const |
| Computes SHA3-256 hash. | |
| std::vector< uint8_t > | compute_HMAC_SHA_256 (const std::vector< uint8_t > &key, const std::vector< uint8_t > &input) const |
| Computes HMAC-SHA-256 message authentication code. | |
| std::vector< uint8_t > | compute_CMAC_AES (const std::vector< uint8_t > &key, const std::vector< uint8_t > &input) const |
| Computes CMAC-AES message authentication code. | |
| std::vector< uint8_t > | get_merkle_root () const |
| Gets the Merkle Tree root node ( \( x_{4,0} \)). | |
| std::string | get_public_key_type () const |
| Gets the ECDSA Public Key type (ECDSA P-256 / ECDSA P-521 / Unknown). | |
| void | set_public_key (const std::vector< uint8_t > &publickey) |
| Sets the ECDSA Public Key (publickey compressed format). | |
| void | set_public_key_type (const std::string &public_key_type) |
| Sets the ECDSA Public Key type (ECDSA P-256 / ECDSA P-521). | |
| void | set_merkle_root (const std::vector< uint8_t > &v) |
| Sets the Merkle Tree root node x( \( x_{4,0} \)). | |
| void | read_merkle_xml (const std::string &merkleFilePath) |
Class implementing cryptographic functions for Navigation Message Authentication.
Definition at line 41 of file gnss_crypto.h.
| Gnss_Crypto::Gnss_Crypto | ( | ) |
Default constructor.
| Gnss_Crypto::Gnss_Crypto | ( | const std::string & | certFilePath, |
| const std::string & | merkleTreePath ) |
Constructor with a .crt or .pem file for the ECDSA Public Key and a XML file for the Merkle Tree root. Files can be downloaded by registering at https://www.gsc-europa.eu/
| Gnss_Crypto::~Gnss_Crypto | ( | ) |
Default destructor.
| std::vector< uint8_t > Gnss_Crypto::compute_CMAC_AES | ( | const std::vector< uint8_t > & | key, |
| const std::vector< uint8_t > & | input ) const |
Computes CMAC-AES message authentication code.
| std::vector< uint8_t > Gnss_Crypto::compute_HMAC_SHA_256 | ( | const std::vector< uint8_t > & | key, |
| const std::vector< uint8_t > & | input ) const |
Computes HMAC-SHA-256 message authentication code.
| std::vector< uint8_t > Gnss_Crypto::compute_SHA3_256 | ( | const std::vector< uint8_t > & | input | ) | const |
Computes SHA3-256 hash.
| std::vector< uint8_t > Gnss_Crypto::compute_SHA_256 | ( | const std::vector< uint8_t > & | input | ) | const |
Computes SHA-256 hash.
| std::vector< uint8_t > Gnss_Crypto::get_merkle_root | ( | ) | const |
Gets the Merkle Tree root node ( \( x_{4,0} \)).
| std::string Gnss_Crypto::get_public_key_type | ( | ) | const |
Gets the ECDSA Public Key type (ECDSA P-256 / ECDSA P-521 / Unknown).
| bool Gnss_Crypto::have_public_key | ( | ) | const |
Returns true if the ECDSA Public Key is already loaded.
| void Gnss_Crypto::set_merkle_root | ( | const std::vector< uint8_t > & | v | ) |
Sets the Merkle Tree root node x( \( x_{4,0} \)).
| void Gnss_Crypto::set_public_key | ( | const std::vector< uint8_t > & | publickey | ) |
Sets the ECDSA Public Key (publickey compressed format).
| void Gnss_Crypto::set_public_key_type | ( | const std::string & | public_key_type | ) |
Sets the ECDSA Public Key type (ECDSA P-256 / ECDSA P-521).
| bool Gnss_Crypto::store_public_key | ( | const std::string & | pubKeyFilePath | ) | const |
Stores the ECDSA Public Key in a .pem file, which is read in a following run if the .crt file is not found
| bool Gnss_Crypto::verify_signature_ecdsa_p256 | ( | const std::vector< uint8_t > & | message, |
| const std::vector< uint8_t > & | signature ) const |
Verify ECDSA-P256 signature (message in plain hex, signature in raw format).
| bool Gnss_Crypto::verify_signature_ecdsa_p521 | ( | const std::vector< uint8_t > & | message, |
| const std::vector< uint8_t > & | signature ) const |
Verify ECDSA-P521 signature (message in plain hex, signature in raw format).