Example #1
0
        /// <summary>
        /// Initialize method implementation
        /// </summary>
        public void Initialize(MFAConfig config)
        {
            _cfg = config;
            _connectionstring = config.KeysConfig.ExternalKeyManager.Parameters.Data;
            _validity         = config.KeysConfig.CertificateValidity;
            _ksize            = config.KeysConfig.KeySize;
            _repos            = new CustomKeysRepositoryService(_cfg);
            switch (_ksize)
            {
            case KeySizeMode.KeySize512:
                MAX_PROBE_LEN = 64;
                break;

            case KeySizeMode.KeySize1024:
                MAX_PROBE_LEN = 128;
                break;

            case KeySizeMode.KeySize2048:
                MAX_PROBE_LEN = 256;
                break;

            default:
                MAX_PROBE_LEN = 128;
                break;
            }
        }
Example #2
0
        /// <summary>
        /// Initialize method implementation
        /// </summary>
        public void Initialize(MFAConfig config)
        {
            _config  = config;
            _mode    = config.KeysConfig.KeyGenerator;
            _ksize   = config.KeysConfig.KeySize;
            _version = config.KeysConfig.KeyVersion;
            if (!string.IsNullOrEmpty(config.KeysConfig.XORSecret))
            {
                _xorsecret = config.KeysConfig.XORSecret;
            }
            if (_config.UseActiveDirectory)
            {
                _repos = new ADDSKeysRepositoryService(_config);
            }
            else
            {
                _repos = new SQLKeysRepositoryService(_config);
            }
            switch (_ksize)
            {
            case KeySizeMode.KeySize128:
                MAX_PROBE_LEN = 16;
                break;

            case KeySizeMode.KeySize256:
                MAX_PROBE_LEN = 32;
                break;

            case KeySizeMode.KeySize384:
                MAX_PROBE_LEN = 48;
                break;

            case KeySizeMode.KeySize512:
                MAX_PROBE_LEN = 64;
                break;

            case KeySizeMode.KeySize1024:
                MAX_PROBE_LEN = 128;
                break;

            case KeySizeMode.KeySize2048:
                MAX_PROBE_LEN = 256;
                break;

            default:
                MAX_PROBE_LEN = 128;
                break;
            }
        }
Example #3
0
        /// <summary>
        /// Initialize method implementation
        /// </summary>
        public void Initialize(MFAConfig config)
        {
            _config           = config;
            _connectionstring = config.KeysConfig.ExternalKeyManager.ConnectionString;
            _dataparameters   = config.KeysConfig.ExternalKeyManager.Parameters.Data;
            _validity         = config.KeysConfig.CertificateValidity;
            _ksize            = config.KeysConfig.KeySize;
            if (!string.IsNullOrEmpty(config.KeysConfig.XORSecret))
            {
                _xorsecret = config.KeysConfig.XORSecret;
            }
            _repos = new DBKeysRepositoryService(_config);
            switch (_ksize)
            {
            case KeySizeMode.KeySize128:
                MAX_PROBE_LEN = 16;
                break;

            case KeySizeMode.KeySize256:
                MAX_PROBE_LEN = 32;
                break;

            case KeySizeMode.KeySize384:
                MAX_PROBE_LEN = 48;
                break;

            case KeySizeMode.KeySize512:
                MAX_PROBE_LEN = 64;
                break;

            case KeySizeMode.KeySize1024:
                MAX_PROBE_LEN = 128;
                break;

            case KeySizeMode.KeySize2048:
                MAX_PROBE_LEN = 256;
                break;

            default:
                MAX_PROBE_LEN = 128;
                break;
            }
        }