4
4
5
5
use crate :: error:: { Error , Result } ;
6
6
use cryptoki_sys:: * ;
7
- use secrecy:: SecretString ;
8
- use secrecy:: SecretVec ;
7
+ use secrecy:: { SecretBox , SecretString } ;
9
8
use std:: convert:: TryFrom ;
10
9
use std:: convert:: TryInto ;
11
10
use std:: fmt:: Formatter ;
@@ -29,7 +28,7 @@ impl Date {
29
28
///
30
29
/// # Errors
31
30
///
32
- /// If the lengths are invalid a `Error::InvalidValue` will be returned
31
+ /// If the lengths are invalid, an `Error::InvalidValue` will be returned
33
32
pub fn new_from_str_slice ( year : & str , month : & str , day : & str ) -> Result < Self > {
34
33
if year. len ( ) != 4 || month. len ( ) != 2 || day. len ( ) != 2 {
35
34
Err ( Error :: InvalidValue )
@@ -222,22 +221,22 @@ impl From<CK_VERSION> for Version {
222
221
/// A UTC datetime returned by a token's clock if present.
223
222
#[ derive( Copy , Clone , Debug ) ]
224
223
pub struct UtcTime {
225
- /// **[Conformance](crate#conformance-notes):**
224
+ /// **[Conformance](crate#conformance-notes): **
226
225
/// Guaranteed to be in range 0..=9999
227
226
pub year : u16 ,
228
- /// **[Conformance](crate#conformance-notes):**
227
+ /// **[Conformance](crate#conformance-notes): **
229
228
/// Guaranteed to be in range 0..=99
230
229
pub month : u8 ,
231
- /// **[Conformance](crate#conformance-notes):**
230
+ /// **[Conformance](crate#conformance-notes): **
232
231
/// Guaranteed to be in range 0..=99
233
232
pub day : u8 ,
234
- /// **[Conformance](crate#conformance-notes):**
233
+ /// **[Conformance](crate#conformance-notes): **
235
234
/// Guaranteed to be in range 0..=99
236
235
pub hour : u8 ,
237
- /// **[Conformance](crate#conformance-notes):**
236
+ /// **[Conformance](crate#conformance-notes): **
238
237
/// Guaranteed to be in range 0..=99
239
238
pub minute : u8 ,
240
- /// **[Conformance](crate#conformance-notes):**
239
+ /// **[Conformance](crate#conformance-notes): **
241
240
/// Guaranteed to be in range 0..=99
242
241
pub second : u8 ,
243
242
}
@@ -248,7 +247,7 @@ impl UtcTime {
248
247
/// PKCS#11 and ISO are unrelated standards, and this function is provided
249
248
/// only for convenience. ISO format is more widely recognized and parsable
250
249
/// by various date/time utilities, while PKCS#11's internal representation
251
- /// of this type is is not used elsewhere.
250
+ /// of this type is not used elsewhere.
252
251
/// Other than formatting, this crate does not guarantee or enforce any part
253
252
/// of the ISO standard.
254
253
pub fn as_iso8601_string ( & self ) -> String {
@@ -281,7 +280,7 @@ pub type AuthPin = SecretString;
281
280
/// Secret wrapper for a raw non UTF-8 Pin
282
281
///
283
282
/// Enable the `serde` feature to add support for Deserialize
284
- pub type RawAuthPin = SecretVec < u8 > ;
283
+ pub type RawAuthPin = SecretBox < Vec < u8 > > ;
285
284
286
285
#[ cfg( test) ]
287
286
mod test {
0 commit comments