1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
#![crate_name = "yubihsm"]
#![crate_type = "rlib"]
#![cfg_attr(clippy, feature(tool_lints))]
#![deny(warnings, missing_docs, trivial_casts, trivial_numeric_casts)]
#![deny(unsafe_code, unused_import_braces, unused_qualifications)]
#![doc(
html_logo_url = "https://raw.githubusercontent.com/tendermint/yubihsm-rs/master/img/logo.png",
html_root_url = "https://docs.rs/yubihsm/0.16.0"
)]
extern crate aes;
#[macro_use]
extern crate bitflags;
extern crate block_modes;
extern crate byteorder;
extern crate clear_on_drop;
extern crate cmac;
#[macro_use]
extern crate failure;
#[macro_use]
extern crate failure_derive;
#[cfg(feature = "hmac")]
extern crate hmac;
#[cfg(feature = "usb")]
#[macro_use]
extern crate lazy_static;
#[cfg(feature = "usb")]
extern crate libusb;
#[macro_use]
extern crate log;
#[cfg(feature = "pbkdf2")]
extern crate pbkdf2;
extern crate rand;
#[cfg(feature = "mockhsm")]
extern crate ring;
extern crate serde;
#[macro_use]
extern crate serde_derive;
#[cfg(feature = "sha2")]
extern crate sha2;
extern crate subtle;
#[cfg(feature = "mockhsm")]
extern crate untrusted;
extern crate uuid;
#[macro_use]
pub mod error;
#[macro_use]
mod serializers;
pub mod adapters;
pub mod algorithm;
pub(crate) mod audit;
pub mod auth_key;
pub mod capabilities;
pub mod commands;
pub mod credentials;
pub mod domains;
#[cfg(feature = "mockhsm")]
pub mod mockhsm;
pub mod object;
pub mod response;
mod securechannel;
mod serial_number;
pub mod session;
pub mod wrap;
#[cfg(feature = "http")]
pub use adapters::http::{HttpAdapter, HttpConfig};
#[cfg(feature = "usb")]
pub use adapters::usb::{UsbAdapter, UsbDevices, UsbTimeout};
pub use adapters::Adapter;
pub use algorithm::*;
pub use audit::AuditOption;
pub use auth_key::{AuthKey, AUTH_KEY_SIZE};
pub use capabilities::Capability;
pub use commands::{
attest_asymmetric::*, blink::*, delete_object::*, device_info::*, echo::*, export_wrapped::*,
generate_asymmetric_key::*, generate_hmac_key::*, generate_wrap_key::*, get_logs::*,
get_object_info::*, get_opaque::*, get_option::*, get_pseudo_random::*, get_pubkey::*, hmac::*,
import_wrapped::*, list_objects::*, put_asymmetric_key::*, put_auth_key::*, put_hmac_key::*,
put_opaque::*, put_option::*, put_otp_aead_key::*, put_wrap_key::*, reset::*, set_log_index::*,
sign_ecdsa::*, sign_eddsa::*, storage_status::*, unwrap_data::*, verify_hmac::*, wrap_data::*,
CommandType,
};
#[cfg(feature = "rsa")]
pub use commands::{sign_rsa_pkcs1v15::*, sign_rsa_pss::*};
pub use credentials::Credentials;
pub use domains::Domain;
pub use error::*;
#[cfg(feature = "mockhsm")]
pub use mockhsm::{MockAdapter, MockSession};
pub use object::*;
pub use response::ResponseCode;
pub use securechannel::SessionId;
pub use serial_number::SerialNumber;
#[cfg(feature = "http")]
pub use session::HttpSession;
#[cfg(feature = "usb")]
pub use session::UsbSession;
pub use session::{Session, SessionError};
pub use uuid::Uuid;
pub use wrap::{WrapMessage, WrapNonce};