포트
호스트가 이 포트들을 구현해 WalletPorts로 주입합니다. SDK는 Rng·WalletClock·TransactionLogStore의 기본 구현을 제공하며, 최소한 SecureArea·StorageDriver·HttpTransport는 직접 공급해야 합니다.
SecureArea
보안 경계를 벗어나지 않는 키 재료를 생성·사용합니다. Android Keystore 또는 iOS Secure Enclave로 뒷받침하세요. 테스트용 소프트웨어 구현도 있습니다.
- Kotlin
- Swift
interface SecureArea {
val id: SecureAreaId
suspend fun createKey(spec: KeySpec): KeyInfo
suspend fun publicKey(handle: KeyHandle): EcPublicKey
// 서명은 SecureAreaJwsSigner / SecureAreaCoseSigner로 노출됩니다
}
public protocol SecureArea {
var id: SecureAreaId { get }
func createKey(spec: KeySpec) async throws -> KeyInfo
func publicKey(key: KeyHandle) async throws -> EcPublicKey
// 서명은 SecureAreaJwsSigner / SecureAreaCoseSigner로 노출됩니다
}
StorageDriver
컬렉션 + 키로 바이트를 영속하고 트랜잭션 스코프를 제공합니다. 프로덕션에서는 저장 시 암호화로 감싸세요.
- Kotlin
- Swift
interface StorageDriver {
suspend fun put(collection: String, key: String, value: ByteArray)
suspend fun get(collection: String, key: String): ByteArray?
suspend fun delete(collection: String, key: String)
suspend fun keys(collection: String): List<String>
suspend fun transaction(block: suspend StorageTx.() -> Unit)
}
public protocol StorageDriver: Sendable {
func put(collection: String, key: String, value: [UInt8]) async throws
func get(collection: String, key: String) async throws -> [UInt8]?
func delete(collection: String, key: String) async throws
func keys(collection: String) async throws -> [String]
func transaction(_ block: (any StorageTx) async throws -> Void) async throws
}
HttpTransport
request.followRedirects를 반드시 존중해야 합니다 — OpenID 플로우가 리다이렉트 가로채기에 의존합니다.
- Kotlin
- Swift
interface HttpTransport {
suspend fun execute(request: HttpRequest): HttpResponse
}
public protocol HttpTransport: Sendable {
func execute(_ request: HttpRequest) async throws -> HttpResponse
}
ProximityTransport
ISO 18013-5용 양방향 프레임 메시지 채널입니다(근접 제시 참고). SDK가 메시지 교환을 구동하고, BLE/NFC 라디오는 당신이 공급합니다.
- Kotlin
- Swift
interface ProximityTransport {
suspend fun send(message: ByteArray)
suspend fun receive(): ByteArray
suspend fun close()
fun retrievalMethods(): List<ByteArray> = emptyList() // QR 인게이지먼트용 BLE DeviceRetrievalMethod
fun nfcCarrier(): NfcCarrier? = null // NFC static handover용 BLE carrier
}
public protocol ProximityTransport: Sendable {
func send(_ message: [UInt8]) async throws
func receive() async throws -> [UInt8]
func close() async
func retrievalMethods() -> [[UInt8]] // QR 인게이지먼트용 BLE DeviceRetrievalMethod
func nfcCarrier() -> NfcCarrier? // NFC static handover용 BLE carrier
}
TransactionLogStore
추가 전용 감사 영속 — 파사드가 wallet.transactions로 감쌉니다.
- Kotlin
- Swift
interface TransactionLogStore {
suspend fun append(entry: TransactionLogEntry)
suspend fun all(): List<TransactionLogEntry>
}
public protocol TransactionLogStore: Sendable {
func append(_ entry: TransactionLogEntry) async
func all() async -> [TransactionLogEntry]
}
WalletAttestationProvider
선택 사항 — 발급 시 wallet-unit attestation(WUA)과 어테스테이션 기반 클라이언트 인증을 위한 Wallet Provider 백엔드 연동입니다.