We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 30b9d19 commit a2b831aCopy full SHA for a2b831a
src/nitrokey/should_use_ccid.py
@@ -0,0 +1,20 @@
1
+import ctypes
2
+import sys
3
+from importlib.util import find_spec
4
+
5
6
+def should_default_ccid() -> bool:
7
+ if find_spec("smartcard") is None:
8
+ return False
9
10
+ if sys.platform != "win32" and sys.platform != "cygwin":
11
+ # Linux or MacOS don't need admin to access with CTAPHID
12
13
14
+ try:
15
+ if ctypes.windll.shell32.IsUserAnAdmin():
16
17
+ else:
18
+ return True
19
+ except Exception:
20
0 commit comments