IsPublic() private static method

Find whether a DSS key blob is public.
private static IsPublic ( byte keyBlob ) : bool
keyBlob byte
return bool
示例#1
0
        public override void ImportParameters(DSAParameters parameters)
        {
            DSACspObject @object = DSACryptoServiceProvider.DSAStructToObject(parameters);

            if (this._safeKeyHandle != null && !this._safeKeyHandle.IsClosed)
            {
                this._safeKeyHandle.Dispose();
            }
            this._safeKeyHandle = SafeKeyHandle.InvalidHandle;
            if (DSACryptoServiceProvider.IsPublic(parameters))
            {
                Utils._ImportKey(Utils.StaticDssProvHandle, 8704, CspProviderFlags.NoFlags, (object)@object, ref this._safeKeyHandle);
            }
            else
            {
                KeyContainerPermission            containerPermission = new KeyContainerPermission(KeyContainerPermissionFlags.NoFlags);
                KeyContainerPermissionAccessEntry accessEntry         = new KeyContainerPermissionAccessEntry(this._parameters, KeyContainerPermissionFlags.Import);
                containerPermission.AccessEntries.Add(accessEntry);
                containerPermission.Demand();
                if (this._safeProvHandle == null)
                {
                    this._safeProvHandle = Utils.CreateProvHandle(this._parameters, this._randomKeyContainer);
                }
                Utils._ImportKey(this._safeProvHandle, 8704, this._parameters.Flags, (object)@object, ref this._safeKeyHandle);
            }
        }
示例#2
0
 public void ImportCspBlob(byte[] keyBlob)
 {
     Utils.ImportCspBlobHelper(CspAlgorithmType.Dss, keyBlob, DSACryptoServiceProvider.IsPublic(keyBlob), ref this._parameters, this._randomKeyContainer, ref this._safeProvHandle, ref this._safeKeyHandle);
 }