mirror of
https://github.com/LordGrimmauld/yubi-oath-rs.git
synced 2025-03-04 05:44:40 +01:00
turn into a proper library with a separate example
the example can be built with cargo run --example example
This commit is contained in:
parent
a111a1b41f
commit
dd7eb63afb
8 changed files with 21 additions and 19 deletions
26
Cargo.lock
generated
26
Cargo.lock
generated
|
@ -121,19 +121,7 @@ dependencies = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "lib_ykoath2"
|
||||||
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"
|
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"apdu-core",
|
"apdu-core",
|
||||||
|
@ -150,6 +138,18 @@ dependencies = [
|
||||||
"strum_macros",
|
"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]]
|
[[package]]
|
||||||
name = "ouroboros"
|
name = "ouroboros"
|
||||||
version = "0.18.5"
|
version = "0.18.5"
|
||||||
|
|
|
@ -13,9 +13,13 @@ strum = { version = "0.27.0", features = [ ] }
|
||||||
strum_macros = "0.27.0"
|
strum_macros = "0.27.0"
|
||||||
|
|
||||||
[package]
|
[package]
|
||||||
name = "oath-rs-experiments"
|
name = "lib_ykoath2"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["Grimmauld <grimmauld@grimmauld.de>"]
|
authors = ["Grimmauld <grimmauld@grimmauld.de>"]
|
||||||
description = "experiments with smartcards"
|
description = "experiments with smartcards"
|
||||||
license-file = "LICENSE"
|
license-file = "LICENSE"
|
||||||
|
|
||||||
|
[[example]]
|
||||||
|
name = "example"
|
||||||
|
path = "./src/example.rs"
|
|
@ -1,7 +1,5 @@
|
||||||
// SPDX-License-Identifier: BSD-3-Clause
|
// SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
mod lib_ykoath2;
|
|
||||||
|
|
||||||
use core::time;
|
use core::time;
|
||||||
use lib_ykoath2::OathSession;
|
use lib_ykoath2::OathSession;
|
||||||
use pcsc;
|
use pcsc;
|
|
@ -1,7 +1,7 @@
|
||||||
use std::cmp::Ordering;
|
use std::cmp::Ordering;
|
||||||
use std::hash::{Hash, Hasher};
|
use std::hash::{Hash, Hasher};
|
||||||
|
|
||||||
use crate::lib_ykoath2::CredentialIDData;
|
use crate::CredentialIDData;
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct OathCredential {
|
pub struct OathCredential {
|
|
@ -2,7 +2,7 @@ use regex::Regex;
|
||||||
|
|
||||||
use std::fmt::Display;
|
use std::fmt::Display;
|
||||||
|
|
||||||
use crate::lib_ykoath2::{OathType, Tag, DEFAULT_PERIOD};
|
use crate::{OathType, Tag, DEFAULT_PERIOD};
|
||||||
|
|
||||||
#[derive(Debug, Eq, PartialEq, Clone)]
|
#[derive(Debug, Eq, PartialEq, Clone)]
|
||||||
pub struct CredentialIDData {
|
pub struct CredentialIDData {
|
|
@ -9,7 +9,7 @@ use pcsc::{Card, Transaction};
|
||||||
|
|
||||||
use std::ffi::CString;
|
use std::ffi::CString;
|
||||||
|
|
||||||
use crate::lib_ykoath2::{ErrorResponse, Instruction, SuccessResponse, Tag};
|
use crate::{ErrorResponse, Instruction, SuccessResponse, Tag};
|
||||||
|
|
||||||
#[derive(PartialEq, Eq, Debug)]
|
#[derive(PartialEq, Eq, Debug)]
|
||||||
pub enum FormattableErrorResponse {
|
pub enum FormattableErrorResponse {
|
Loading…
Add table
Reference in a new issue