Exemple #1
0
        public override DSAParameters ExportParameters(bool includePrivateParameters)
        {
            this.GetKeyPair();
            if (includePrivateParameters)
            {
                KeyContainerPermission            containerPermission = new KeyContainerPermission(KeyContainerPermissionFlags.NoFlags);
                KeyContainerPermissionAccessEntry accessEntry         = new KeyContainerPermissionAccessEntry(this._parameters, KeyContainerPermissionFlags.Export);
                containerPermission.AccessEntries.Add(accessEntry);
                containerPermission.Demand();
            }
            DSACspObject dsaCspObject = new DSACspObject();

            Utils._ExportKey(this._safeKeyHandle, includePrivateParameters ? 7 : 6, (object)dsaCspObject);
            return(DSACryptoServiceProvider.DSAObjectToStruct(dsaCspObject));
        }