Example #1
0
 public override void Dispose(bool disposing)
 {
     if (disposing)
     {
         _ctx?.Dispose();
     }
 }
Example #2
0
            internal AppleDigestProvider(Interop.AppleCrypto.PAL_HashAlgorithm algorithm)
            {
                int hashSizeInBytes;

                _ctx = Interop.AppleCrypto.DigestCreate(algorithm, out hashSizeInBytes);

                if (hashSizeInBytes < 0)
                {
                    _ctx.Dispose();
                    throw new PlatformNotSupportedException(
                              SR.Format(
                                  SR.Cryptography_UnknownHashAlgorithm,
                                  Enum.GetName(typeof(Interop.AppleCrypto.PAL_HashAlgorithm), algorithm)));
                }

                if (_ctx.IsInvalid)
                {
                    _ctx.Dispose();
                    throw new CryptographicException();
                }

                HashSizeInBytes = hashSizeInBytes;
            }
Example #3
0
 public void Dispose()
 {
     _ctx.Dispose();
 }