Im porting a windows application for Mac using Mono.I cannot use DPAPI in Mac and i think there is restriction in getting Mainboard/CPU id in Mac for User Level programs.So is there something like DPAPI in windows which i can use using Mono to get a unique system id that does not change.
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Generic Generics in Managed C++
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
First, stay away from using a MAC address as those can change (spoofed or hardware change) and is not a very Mac'ie way since 10.3/4?... Since then the "I/O Kit registry" is the preferred method to get a system id. Drop to a cmd line and
man ioreg
for same details.So, not sure if you are using Xamarin.Mac or not, so if you are you could do a binding of the IOKit IORegistryEntryFromPath/IORegistryEntryCreateCFProperty APIs as I do not believe those are currently in C# wrappers, but really quick way that I use is:
Example output:
You could also parse out "IOPlatformSerialNumber" instead of the "IOPlatformUUID" if you want something human readable and that someone can find on the main dialog of "About This Mac" for tech support calls...
Now if you are looking at storing and protecting info as in the MS DPAPI, the KeyChain is the place to do that (OSX/iOS). Mono does have some of the DPAPI crypto apis that are x-plat based.