private void SetKey(SecKeyPair keyPair)
        {
            SecKeyPair current = _keys;

            _keys = keyPair;
            current?.Dispose();
        }
        private void SetKey(SecKeyPair keyPair)
        {
            ThrowIfDisposed();

            SecKeyPair?current = _keys;

            _keys = keyPair;
            current?.Dispose();
        }
            protected override void Dispose(bool disposing)
            {
                if (disposing)
                {
                    // Do not set _keys to null, in order to prevent rehydration.
                    _keys?.Dispose();
                }

                base.Dispose(disposing);
            }
Beispiel #4
0
            protected override void Dispose(bool disposing)
            {
                if (disposing)
                {
                    _keys?.Dispose();
                    _keys = null;
                }

                base.Dispose(disposing);
            }
Beispiel #5
0
            private void SetKey(SecKeyPair newKeyPair)
            {
                SecKeyPair current = _keys;

                _keys = newKeyPair;
                current?.Dispose();

                if (newKeyPair != null)
                {
                    KeySizeValue = Interop.AppleCrypto.GetSimpleKeySizeInBits(newKeyPair.PublicKey);
                }
            }
            private void SetKey(SecKeyPair newKeyPair)
            {
                ThrowIfDisposed();

                SecKeyPair?current = _keys;

                _keys = newKeyPair;
                current?.Dispose();

                if (newKeyPair != null)
                {
                    int size = Interop.AppleCrypto.GetSimpleKeySizeInBits(newKeyPair.PublicKey);
                    KeySizeValue = size;
                }
            }
Beispiel #7
0
            private void SetKey(SecKeyPair newKeyPair)
            {
                SecKeyPair current = _keys;

                _keys = newKeyPair;
                current?.Dispose();

                if (newKeyPair != null)
                {
                    long size = Interop.AppleCrypto.EccGetKeySizeInBits(newKeyPair.PublicKey);

                    Debug.Assert(size == 256 || size == 384 || size == 521, $"Unknown keysize ({size})");
                    KeySizeValue = (int)size;
                }
            }
Beispiel #8
0
            protected override void Dispose(bool disposing)
            {
                if (disposing)
                {
                    if (_keys != null)
                    {
                        _keys.Dispose();
                        _keys = null;
                    }

                    _disposed = true;
                }

                base.Dispose(disposing);
            }
 public void Dispose()
 {
     _keys?.Dispose();
     _keys = null;
 }
 internal void DisposeKey()
 {
     _keys?.Dispose();
     _keys = null;
 }