SE050 Driver
API reference
Loading...
Searching...
No Matches
Classes | Namespaces | Typedefs | Enumerations | Functions | Variables
se050_commands.hpp File Reference

Typed SE050 command builders/parsers for a core management/object subset. More...

#include "se050_apdu.hpp"
#include "se050_tlv.hpp"
#include "se050_types.hpp"
#include <array>
#include <cstddef>
#include <cstring>
#include <cstdint>

Go to the source code of this file.

Classes

struct  se050::cmd::VersionInfo
 

Namespaces

namespace  se050
 
namespace  se050::cmd
 

Typedefs

using se050::cmd::ObjectId = std::array< std::uint8_t, 4 >
 

Enumerations

enum class  se050::cmd::MemoryType : std::uint8_t { se050::cmd::Persistent = 0x01 , se050::cmd::TransientReset = 0x02 , se050::cmd::TransientDeselect = 0x03 }
 
enum class  se050::cmd::EcCurve : std::uint8_t {
  se050::cmd::NistP192 = 0x01 , se050::cmd::NistP224 = 0x02 , se050::cmd::NistP256 = 0x03 , se050::cmd::NistP384 = 0x04 ,
  se050::cmd::NistP521 = 0x05
}
 
enum class  se050::cmd::EcdsaAlgo : std::uint8_t {
  se050::cmd::Sha1 = 0x11 , se050::cmd::Sha224 = 0x25 , se050::cmd::Sha256 = 0x21 , se050::cmd::Sha384 = 0x22 ,
  se050::cmd::Sha512 = 0x26
}
 

Functions

Error se050::cmd::BuildGetVersion (std::uint8_t *out, std::size_t out_cap, std::size_t *out_len) noexcept
 
Error se050::cmd::BuildGetRandom (std::uint16_t random_len, std::uint8_t *out, std::size_t out_cap, std::size_t *out_len) noexcept
 
Error se050::cmd::BuildGetFreeMemory (MemoryType memory_type, std::uint8_t *out, std::size_t out_cap, std::size_t *out_len) noexcept
 
Error se050::cmd::BuildDeleteSecureObject (const ObjectId &object_id, std::uint8_t *out, std::size_t out_cap, std::size_t *out_len) noexcept
 
Error se050::cmd::BuildCheckObjectExists (const ObjectId &object_id, std::uint8_t *out, std::size_t out_cap, std::size_t *out_len) noexcept
 
Error se050::cmd::BuildGenerateEcKeyPair (const ObjectId &object_id, EcCurve curve, std::uint8_t *out, std::size_t out_cap, std::size_t *out_len) noexcept
 
Error se050::cmd::BuildWriteBinary (const ObjectId &object_id, const std::uint8_t *data, std::size_t data_len, bool has_offset, std::uint16_t offset, bool has_file_length, std::uint16_t file_length, std::uint8_t *out, std::size_t out_cap, std::size_t *out_len) noexcept
 
Error se050::cmd::BuildWriteAesKey (const ObjectId &object_id, const std::uint8_t *key, std::size_t key_len, std::uint8_t *out, std::size_t out_cap, std::size_t *out_len) noexcept
 
Error se050::cmd::BuildCipherOneShot (const ObjectId &key_id, bool decrypt, const std::uint8_t *data, std::size_t data_len, std::uint8_t *out, std::size_t out_cap, std::size_t *out_len) noexcept
 
Error se050::cmd::BuildReadObject (const ObjectId &object_id, bool has_offset, std::uint16_t offset, bool has_length, std::uint16_t length, std::uint8_t *out, std::size_t out_cap, std::size_t *out_len) noexcept
 
Error se050::cmd::BuildEcdsaSign (const ObjectId &key_id, EcdsaAlgo algo, const std::uint8_t *digest, std::size_t digest_len, std::uint8_t *out, std::size_t out_cap, std::size_t *out_len) noexcept
 
Error se050::cmd::BuildEcdsaVerify (const ObjectId &key_id, EcdsaAlgo algo, const std::uint8_t *digest, std::size_t digest_len, const std::uint8_t *signature, std::size_t signature_len, std::uint8_t *out, std::size_t out_cap, std::size_t *out_len) noexcept
 
Error se050::cmd::ParseResponseTag1 (const std::uint8_t *rapdu, std::size_t rapdu_len, const std::uint8_t **value_out, std::size_t *value_len_out, apdu::StatusWords *sw_out) noexcept
 
Error se050::cmd::ParseVersionInfo (const std::uint8_t *rapdu, std::size_t rapdu_len, VersionInfo *out) noexcept
 
Error se050::cmd::ParseFreeMemory (const std::uint8_t *rapdu, std::size_t rapdu_len, std::uint16_t *free_bytes) noexcept
 
Error se050::cmd::ParseDataTag1 (const std::uint8_t *rapdu, std::size_t rapdu_len, std::uint8_t *out, std::size_t out_cap, std::size_t *out_len) noexcept
 
Error se050::cmd::ParseVerifyResult (const std::uint8_t *rapdu, std::size_t rapdu_len, bool *verified) noexcept
 
Error se050::cmd::ParseObjectExistsResult (const std::uint8_t *rapdu, std::size_t rapdu_len, bool *exists) noexcept
 

Variables

constexpr std::uint8_t se050::cmd::kClaNoSm = 0x80U
 
constexpr std::uint8_t se050::cmd::kInsWrite = 0x01U
 
constexpr std::uint8_t se050::cmd::kInsRead = 0x02U
 
constexpr std::uint8_t se050::cmd::kInsCrypto = 0x03U
 
constexpr std::uint8_t se050::cmd::kInsMgmt = 0x04U
 
constexpr std::uint8_t se050::cmd::kP1Default = 0x00U
 
constexpr std::uint8_t se050::cmd::kP1Aes = 0x03U
 
constexpr std::uint8_t se050::cmd::kP1Binary = 0x06U
 
constexpr std::uint8_t se050::cmd::kP1Signature = 0x0CU
 
constexpr std::uint8_t se050::cmd::kP1Cipher = 0x0EU
 
constexpr std::uint8_t se050::cmd::kP1Ec = 0x01U
 
constexpr std::uint8_t se050::cmd::kP1KeyPair = 0x60U
 
constexpr std::uint8_t se050::cmd::kP2Default = 0x00U
 
constexpr std::uint8_t se050::cmd::kP2Version = 0x20U
 
constexpr std::uint8_t se050::cmd::kP2Memory = 0x22U
 
constexpr std::uint8_t se050::cmd::kP2DeleteObject = 0x28U
 
constexpr std::uint8_t se050::cmd::kP2Random = 0x49U
 
constexpr std::uint8_t se050::cmd::kP2Exist = 0x27U
 
constexpr std::uint8_t se050::cmd::kP2Sign = 0x09U
 
constexpr std::uint8_t se050::cmd::kP2Verify = 0x0AU
 
constexpr std::uint8_t se050::cmd::kP2EncryptOneshot = 0x37U
 
constexpr std::uint8_t se050::cmd::kP2DecryptOneshot = 0x38U
 
constexpr std::uint8_t se050::cmd::kCipherAesEcbNopad = 0x0EU
 
constexpr std::uint8_t se050::cmd::kTag1 = 0x41U
 
constexpr std::uint8_t se050::cmd::kTag2 = 0x42U
 
constexpr std::uint8_t se050::cmd::kTag3 = 0x43U
 
constexpr std::uint8_t se050::cmd::kTag5 = 0x45U
 
constexpr std::uint8_t se050::cmd::kResultSuccess = 0x01U
 

Detailed Description

Typed SE050 command builders/parsers for a core management/object subset.