SE050 Driver
API reference
Loading...
Searching...
No Matches
Public Member Functions | List of all members
se050::scp03::Session< TransportT > Class Template Reference

SCP03 session bound to a T=1 transport. More...

#include <se050_scp03.hpp>

Public Member Functions

 Session () noexcept=default
 
 ~Session ()
 Wipes the session keys (see Close).
 
 Session (const Session &)=delete
 session keys are never copied
 
Session & operator= (const Session &)=delete
 session keys are never copied
 
Error OpenSecureChannel (T1Session< TransportT > &t1, const StaticKeys &keys, std::uint32_t timeout_ms) noexcept
 INITIALIZE UPDATE / EXTERNAL AUTHENTICATE.
 
Error Close () noexcept
 Close the channel: wipe session keys, MAC chaining value and counter.
 
bool IsOpen () const noexcept
 
bool Failed () const noexcept
 true after the channel was lost (a response failed its R-MAC, or the exchange broke inside the channel). The device refuses commands with Error::Authentication until Close or a new OpenSecureChannel, so it never falls back to plaintext silently.
 
void Abort () noexcept
 Mark the channel lost and wipe its keys (used by the device on a broken exchange).
 
Error WrapCommand (const std::uint8_t *capdu, std::size_t capdu_len, std::uint8_t *out, std::size_t out_cap, std::size_t *out_len) noexcept
 
Error UnwrapResponse (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
 
ChannelState & State () noexcept
 
const ChannelState & State () const noexcept
 

Detailed Description

template<typename TransportT>
class se050::scp03::Session< TransportT >

SCP03 session bound to a T=1 transport.

Template Parameters
TransportTCRTP I²C transport type used by T1Session.

Constructor & Destructor Documentation

◆ Session() [1/2]

template<typename TransportT >
se050::scp03::Session< TransportT >::Session ( )
defaultnoexcept

◆ ~Session()

template<typename TransportT >
se050::scp03::Session< TransportT >::~Session ( )
inline

Wipes the session keys (see Close).

◆ Session() [2/2]

template<typename TransportT >
se050::scp03::Session< TransportT >::Session ( const Session< TransportT > &  )
delete

session keys are never copied

Member Function Documentation

◆ Abort()

template<typename TransportT >
void se050::scp03::Session< TransportT >::Abort ( )
inlinenoexcept

Mark the channel lost and wipe its keys (used by the device on a broken exchange).

◆ Close()

template<typename TransportT >
Error se050::scp03::Session< TransportT >::Close ( )
inlinenoexcept

Close the channel: wipe session keys, MAC chaining value and counter.

Also clears Failed, so the device sends plaintext again until the next OpenSecureChannel.

◆ Failed()

template<typename TransportT >
bool se050::scp03::Session< TransportT >::Failed ( ) const
inlinenoexcept

true after the channel was lost (a response failed its R-MAC, or the exchange broke inside the channel). The device refuses commands with Error::Authentication until Close or a new OpenSecureChannel, so it never falls back to plaintext silently.

◆ IsOpen()

template<typename TransportT >
bool se050::scp03::Session< TransportT >::IsOpen ( ) const
inlinenoexcept

◆ OpenSecureChannel()

template<typename TransportT >
Error se050::scp03::Session< TransportT >::OpenSecureChannel ( T1Session< TransportT > &  t1,
const StaticKeys &  keys,
std::uint32_t  timeout_ms 
)
inlinenoexcept

INITIALIZE UPDATE / EXTERNAL AUTHENTICATE.

Returns Error::NotSupported when static keys or the 8-byte host challenge are missing. Never returns Ok for a plaintext stand-in.

◆ operator=()

template<typename TransportT >
Session & se050::scp03::Session< TransportT >::operator= ( const Session< TransportT > &  )
delete

session keys are never copied

◆ State() [1/2]

template<typename TransportT >
const ChannelState & se050::scp03::Session< TransportT >::State ( ) const
inlinenoexcept

◆ State() [2/2]

template<typename TransportT >
ChannelState & se050::scp03::Session< TransportT >::State ( )
inlinenoexcept

◆ UnwrapResponse()

template<typename TransportT >
Error se050::scp03::Session< TransportT >::UnwrapResponse ( const std::uint8_t *  rapdu,
std::size_t  rapdu_len,
std::uint8_t *  out,
std::size_t  out_cap,
std::size_t *  out_len 
)
inlinenoexcept

◆ WrapCommand()

template<typename TransportT >
Error se050::scp03::Session< TransportT >::WrapCommand ( const std::uint8_t *  capdu,
std::size_t  capdu_len,
std::uint8_t *  out,
std::size_t  out_cap,
std::size_t *  out_len 
)
inlinenoexcept

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