Example #1
0
        public SecurityPackage(string name)
        {
            // parameters validation
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }

            // query package information
            IntPtr pkgInfo;
            int    error = SSPINative.QuerySecurityPackageInfo(name, out pkgInfo);

            if (error < 0)
            {
                throw new SSPIException(error, "Could not query security package information");
            }

            try
            {
                // initialize package object
                Init(pkgInfo);
            }
            finally
            {
                SSPINative.FreeContextBuffer(pkgInfo);
            }
        }