public DuplicateSafeNCryptKeyHandle(SafeNCryptKeyHandle original)
            : base()
        {
            bool success = false;

            original.DangerousAddRef(ref success);
            if (!success)
            {
                throw new CryptographicException(); // DangerousAddRef() never actually sets success to false, so no need to expend a resource string here.
            }
            SetHandle(original.DangerousGetHandle());
            _original = original;
        }
Exemple #2
0
 public DuplicateSafeNCryptKeyHandle(SafeNCryptKeyHandle original)
     : base()
 {
     bool success = false;
     original.DangerousAddRef(ref success);
     if (!success)
         throw new CryptographicException(); // DangerousAddRef() never actually sets success to false, so no need to expend a resource string here.
     SetHandle(original.DangerousGetHandle());
     _original = original;
 }