turn into a proper library with a separate example

the example can be built with cargo run --example example
This commit is contained in:
Bilal Elmoussaoui 2025-02-13 12:20:35 +01:00
parent a111a1b41f
commit dd7eb63afb
8 changed files with 21 additions and 19 deletions

26
Cargo.lock generated
View file

@ -121,19 +121,7 @@ dependencies = [
]
[[package]]
name = "libc"
version = "0.2.169"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"
[[package]]
name = "memchr"
version = "2.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
[[package]]
name = "oath-rs-experiments"
name = "lib_ykoath2"
version = "0.1.0"
dependencies = [
"apdu-core",
@ -150,6 +138,18 @@ dependencies = [
"strum_macros",
]
[[package]]
name = "libc"
version = "0.2.169"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"
[[package]]
name = "memchr"
version = "2.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
[[package]]
name = "ouroboros"
version = "0.18.5"

View file

@ -13,9 +13,13 @@ strum = { version = "0.27.0", features = [ ] }
strum_macros = "0.27.0"
[package]
name = "oath-rs-experiments"
name = "lib_ykoath2"
version = "0.1.0"
edition = "2021"
authors = ["Grimmauld <grimmauld@grimmauld.de>"]
description = "experiments with smartcards"
license-file = "LICENSE"
[[example]]
name = "example"
path = "./src/example.rs"

View file

@ -1,7 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
mod lib_ykoath2;
use core::time;
use lib_ykoath2::OathSession;
use pcsc;

View file

@ -1,7 +1,7 @@
use std::cmp::Ordering;
use std::hash::{Hash, Hasher};
use crate::lib_ykoath2::CredentialIDData;
use crate::CredentialIDData;
#[derive(Debug, Clone)]
pub struct OathCredential {

View file

@ -2,7 +2,7 @@ use regex::Regex;
use std::fmt::Display;
use crate::lib_ykoath2::{OathType, Tag, DEFAULT_PERIOD};
use crate::{OathType, Tag, DEFAULT_PERIOD};
#[derive(Debug, Eq, PartialEq, Clone)]
pub struct CredentialIDData {

View file

@ -9,7 +9,7 @@ use pcsc::{Card, Transaction};
use std::ffi::CString;
use crate::lib_ykoath2::{ErrorResponse, Instruction, SuccessResponse, Tag};
use crate::{ErrorResponse, Instruction, SuccessResponse, Tag};
#[derive(PartialEq, Eq, Debug)]
pub enum FormattableErrorResponse {