|
1 | 1 | //! OSX specific functionality for items.
|
2 | 2 | use crate::item::ItemSearchOptions;
|
3 | 3 | use crate::os::macos::keychain::SecKeychain;
|
4 |
| -use crate::ItemSearchOptionsInternals; |
5 | 4 |
|
6 | 5 | // Moved to crate::Key
|
7 | 6 | pub use crate::key::KeyType;
|
8 | 7 |
|
9 |
| -/// An extension trait adding OSX specific functionality to `ItemSearchOptions`. |
| 8 | +// TODO: mark as deprecated |
| 9 | +#[doc(hidden)] |
| 10 | +/// An obsolete trait for `ItemSearchOptions`. Use methods on `ItemSearchOptions` directly. |
10 | 11 | pub trait ItemSearchOptionsExt {
|
11 | 12 | /// Search within the specified keychains.
|
12 | 13 | ///
|
13 | 14 | /// If this is not called, the default keychain will be searched.
|
14 | 15 | fn keychains(&mut self, keychains: &[SecKeychain]) -> &mut Self;
|
15 | 16 |
|
16 |
| - /// Only search the protected data keychains. |
17 |
| - /// |
18 |
| - /// Has no effect if a legacy keychain has been explicitly specified |
19 |
| - /// using [keychains](ItemSearchOptionsExt::keychains). |
20 |
| - /// |
21 |
| - /// Has no effect except in sandboxed applications on macOS 10.15 and above |
22 |
| - fn ignore_legacy_keychains(&mut self) -> &mut Self; |
| 17 | + // Do not extend this trait; use `impl ItemSearchOptions` directly |
23 | 18 | }
|
24 | 19 |
|
25 | 20 | impl ItemSearchOptionsExt for ItemSearchOptions {
|
26 |
| - #[inline(always)] |
27 | 21 | fn keychains(&mut self, keychains: &[SecKeychain]) -> &mut Self {
|
28 |
| - ItemSearchOptionsInternals::keychains(self, keychains) |
| 22 | + ItemSearchOptions::keychains(self, keychains) |
29 | 23 | }
|
30 | 24 |
|
31 |
| - #[inline(always)] |
32 |
| - fn ignore_legacy_keychains(&mut self) -> &mut Self { |
33 |
| - ItemSearchOptionsInternals::ignore_legacy_keychains(self) |
34 |
| - } |
| 25 | + // Do not extend this trait; use `impl ItemSearchOptions` directly |
35 | 26 | }
|
36 | 27 |
|
37 | 28 | #[cfg(test)]
|
38 | 29 | mod test {
|
39 | 30 | use crate::item::*;
|
40 | 31 | use crate::os::macos::certificate::SecCertificateExt;
|
41 |
| - use crate::os::macos::item::ItemSearchOptionsExt; |
42 | 32 | use crate::os::macos::test::keychain;
|
43 | 33 | use tempfile::tempdir;
|
44 | 34 |
|
|
0 commit comments