NFCSecureSession
internal final class NFCSecureSession
A class that manages the secure session for NFC communication, including security configuration, secure channels, and secure messaging.
The NFCSecureSession
class is responsible for establishing secure communication sessions
for NFC (Near Field Communication) using SecurityConfiguration
, SecureChannel
, and SecureMessaging
.
Tip: It enables secure data exchange and provides methods for configuring, establishing, and clearing the secure session.
See also
SecurityConfiguration
, SecureChannel
,
SecureMessaging
and SessionKeyGenerator
-
Declaration
Swift
private(set) var securityConfig: SecurityConfiguration? { get }
-
Declaration
Swift
private(set) var secureChannel: SecureChannel? { get }
-
Declaration
Swift
private(set) var secureMessaging: SecureMessaging? { get }
-
Indicates whether a secure session has been successfully established.
Returns
true
if theSecurityConfiguration
,SecureChannel
, andSecureMessaging
have all been set, indicating a successful secure session establishment.Declaration
Swift
internal var isSecureSessionEstablished: Bool { get }
-
Configures the secure session with the specified
SecurityConfiguration
.Declaration
Swift
internal func configure(with config: SecurityConfiguration)
Parameters
config
The
SecurityConfiguration
to be used for the secure session. -
Establishes a secure session with the provided secret key and optional send sequence counter.
Throws
An error if the
SecurityConfiguration
is not set or if key derivation fails.Declaration
Swift
internal func establish(secret: [UInt8], sendSquenceCounter: [UInt8]? = nil) throws
Parameters
secret
The secret key for session key derivation.
sendSquenceCounter
An optional send sequence counter (default is nil).
-
Clears the current secure session, resetting all associated properties to nil.
Declaration
Swift
internal func clear()