44
55use crate :: error:: { Error , Result } ;
66use cryptoki_sys:: * ;
7- use secrecy:: SecretString ;
8- use secrecy:: SecretVec ;
7+ use secrecy:: { SecretBox , SecretString } ;
98use std:: convert:: TryFrom ;
109use std:: convert:: TryInto ;
1110use std:: fmt:: Formatter ;
@@ -29,7 +28,7 @@ impl Date {
2928 ///
3029 /// # Errors
3130 ///
32- /// If the lengths are invalid a `Error::InvalidValue` will be returned
31+ /// If the lengths are invalid, an `Error::InvalidValue` will be returned
3332 pub fn new_from_str_slice ( year : & str , month : & str , day : & str ) -> Result < Self > {
3433 if year. len ( ) != 4 || month. len ( ) != 2 || day. len ( ) != 2 {
3534 Err ( Error :: InvalidValue )
@@ -222,22 +221,22 @@ impl From<CK_VERSION> for Version {
222221/// A UTC datetime returned by a token's clock if present.
223222#[ derive( Copy , Clone , Debug ) ]
224223pub struct UtcTime {
225- /// **[Conformance](crate#conformance-notes):**
224+ /// **[Conformance](crate#conformance-notes): **
226225 /// Guaranteed to be in range 0..=9999
227226 pub year : u16 ,
228- /// **[Conformance](crate#conformance-notes):**
227+ /// **[Conformance](crate#conformance-notes): **
229228 /// Guaranteed to be in range 0..=99
230229 pub month : u8 ,
231- /// **[Conformance](crate#conformance-notes):**
230+ /// **[Conformance](crate#conformance-notes): **
232231 /// Guaranteed to be in range 0..=99
233232 pub day : u8 ,
234- /// **[Conformance](crate#conformance-notes):**
233+ /// **[Conformance](crate#conformance-notes): **
235234 /// Guaranteed to be in range 0..=99
236235 pub hour : u8 ,
237- /// **[Conformance](crate#conformance-notes):**
236+ /// **[Conformance](crate#conformance-notes): **
238237 /// Guaranteed to be in range 0..=99
239238 pub minute : u8 ,
240- /// **[Conformance](crate#conformance-notes):**
239+ /// **[Conformance](crate#conformance-notes): **
241240 /// Guaranteed to be in range 0..=99
242241 pub second : u8 ,
243242}
@@ -248,7 +247,7 @@ impl UtcTime {
248247 /// PKCS#11 and ISO are unrelated standards, and this function is provided
249248 /// only for convenience. ISO format is more widely recognized and parsable
250249 /// 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.
252251 /// Other than formatting, this crate does not guarantee or enforce any part
253252 /// of the ISO standard.
254253 pub fn as_iso8601_string ( & self ) -> String {
@@ -281,7 +280,7 @@ pub type AuthPin = SecretString;
281280/// Secret wrapper for a raw non UTF-8 Pin
282281///
283282/// Enable the `serde` feature to add support for Deserialize
284- pub type RawAuthPin = SecretVec < u8 > ;
283+ pub type RawAuthPin = SecretBox < Vec < u8 > > ;
285284
286285#[ cfg( test) ]
287286mod test {
0 commit comments