protected override bool ReleaseHandle()
        {
            bool successfullyFreed = Interop.Advapi32.CryptDestroyHash(handle);
            Debug.Assert(successfullyFreed);

            SafeProvHandle? parent = _parent;
            _parent = null;
            parent?.DangerousRelease();

            return successfullyFreed;
        }
        internal void SetParent(SafeProvHandle parent)
        {
            if (IsInvalid || IsClosed)
            {
                return;
            }

            Debug.Assert(_parent == null);
            Debug.Assert(!parent.IsClosed);
            Debug.Assert(!parent.IsInvalid);

            _parent = parent;

            bool ignored = false;
            _parent.DangerousAddRef(ref ignored);
        }