static void Initialize()
        {
            if (Interlocked.CompareExchange(ref initialized, 1, 0) != 0)
            {
                return;
            }

            var handle = CFObject.dlopen(SecurityLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }

            try {
                ImportExportPassphase = CFObject.GetStringConstant(handle, "kSecImportExportPassphrase");
                ImportItemIdentity    = CFObject.GetStringConstant(handle, "kSecImportItemIdentity");
                MatchLimit            = CFObject.GetIntPtr(handle, "kSecMatchLimit");
                MatchLimitAll         = CFObject.GetIntPtr(handle, "kSecMatchLimitAll");
                MatchLimitOne         = CFObject.GetIntPtr(handle, "kSecMatchLimitOne");
                SecClassKey           = CFObject.GetIntPtr(handle, "kSecClass");
                SecClassIdentity      = CFObject.GetIntPtr(handle, "kSecClassIdentity");
                SecClassCertificate   = CFObject.GetIntPtr(handle, "kSecClassCertificate");
                ReturnRef             = CFObject.GetIntPtr(handle, "kSecReturnRef");
                MatchSearchList       = CFObject.GetIntPtr(handle, "kSecMatchSearchList");
            } finally {
                CFObject.dlclose(handle);
            }
        }
Esempio n. 2
0
        static SecClass()
        {
            var handle = CFObject.dlopen(AppleTlsContext.SecurityLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }

            try {
                Identity = CFObject.GetIntPtr(handle, "kSecClassIdentity");
            } finally {
                CFObject.dlclose(handle);
            }
        }
Esempio n. 3
0
        static SecItem()
        {
            var handle = CFObject.dlopen(AppleTlsContext.SecurityLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }

            try {
                ReturnRef = CFObject.GetIntPtr(handle, "kSecReturnRef");
            } finally {
                CFObject.dlclose(handle);
            }
        }
Esempio n. 4
0
        static SecKeyChain()
        {
            var handle = CFObject.dlopen(AppleTlsContext.SecurityLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }

            try {
                MatchLimit    = CFObject.GetIntPtr(handle, "kSecMatchLimit");
                MatchLimitAll = CFObject.GetIntPtr(handle, "kSecMatchLimitAll");
                MatchLimitOne = CFObject.GetIntPtr(handle, "kSecMatchLimitOne");
            } finally {
                CFObject.dlclose(handle);
            }
        }