Esempio n. 1
0
        public virtual void Dispose()
        {
            if (_fpeProcessor != null)
            {
                _fpeProcessor.ShutDown();
            }

            if (_ffsCache != null)
            {
                _ffsCache.Dispose();
                _ffsCache = null;
            }

            if (_fpeCache != null)
            {
                _fpeCache.Dispose();
                _fpeCache = null;
            }

            if (_fpeTransactions != null)
            {
                _fpeTransactions.Dispose();
                _fpeTransactions = null;
            }

            if (_ubiqWebServices != null)
            {
                _ubiqWebServices.Dispose();
                _ubiqWebServices = null;
            }
        }
Esempio n. 2
0
        public void Dispose()
        {
            if (_ubiqWebServices != null)
            {
                // reports decryption key usage to server, if applicable
                ResetAsync().Wait();

                _ubiqWebServices.Dispose();
                _ubiqWebServices = null;
            }
        }
Esempio n. 3
0
        private const int _ff1_base2_min_length = 20;         // NIST requirement ceil(log(2(1000000)))

        #endregion

        #region Constructors

        public UbiqFPEEncryptDecrypt(IUbiqCredentials ubiqCredentials)
        {
            _isInited        = false;
            _ubiqCredentials = ubiqCredentials;
            _ubiqWebServices = new UbiqWebServices(_ubiqCredentials);
            _ffsCache        = new FfsCacheManager(_ubiqCredentials, _ubiqWebServices);
            _fpeCache        = new FpeEncryptedKeyCacheManager(_ubiqCredentials, _ubiqWebServices);
            _fpeTransactions = new FpeTransactionManager(new UbiqWebServices(_ubiqCredentials));
            _fpeProcessor    = new FpeProcessor(_fpeTransactions, 1);
            _fpeProcessor.StartUp();
        }
Esempio n. 4
0
        public virtual void Dispose()
        {
            if (_ubiqWebServices != null)
            {
                if (_encryptionKey != null)
                {
                    // if key was used less times than requested, notify the server.
                    if (_useCount < _usesRequested)
                    {
                        _ubiqWebServices.UpdateEncryptionKeyUsageAsync(_useCount, _usesRequested,
                                                                       _encryptionKey.KeyFingerprint, _encryptionKey.EncryptionSession).Wait();
                    }
                }

                _ubiqWebServices.Dispose();
                _ubiqWebServices = null;
            }
        }
Esempio n. 5
0
 public UbiqDecrypt(IUbiqCredentials ubiqCredentials)
 {
     _ubiqWebServices = new UbiqWebServices(ubiqCredentials);
 }
Esempio n. 6
0
 public UbiqEncrypt(IUbiqCredentials ubiqCredentials, int usesRequested)
 {
     _ubiqCredentials = ubiqCredentials;
     _usesRequested   = usesRequested;
     _ubiqWebServices = new UbiqWebServices(_ubiqCredentials);
 }