Exemplo n.º 1
0
 /// <summary>
 /// CreateKeyManager method
 /// </summary>
 public ISecretKeyManager CreateInstance(SecretKeyVersion version)
 {
     if (version == SecretKeyVersion.V2)
     {
         return(new DBKeyManager.RSADBKeyManagerV2());
     }
     else
     {
         return(new DBKeyManager.RSADBKeyManagerV1());
     }
 }
 /// <summary>
 /// CreateKeyManager method
 /// </summary>
 public ISecretKeyManager CreateInstance(SecretKeyVersion version)
 {
     if (version == SecretKeyVersion.V2)
     {
         return(new AESKeyManager.AES256KeyManager());
     }
     else
     {
         return(new AESKeyManager.AES128KeyManager());
     }
 }
 /// <summary>
 /// CreateKeyManager method
 /// </summary>
 public ISecretKeyManager CreateInstance(SecretKeyVersion version)
 {
     if (version == SecretKeyVersion.V1)
     {
         return(new CaesarKeyManager.CaesarKeyManagerV1());
     }
     else
     {
         return(new CaesarKeyManager.CaesarKeyManagerV2());
     }
 }
 public override bool Equals(object obj)
 {
     SecretKeyVersion paramobj = SecretKeyVersion.V2;
     if (obj is MMCLibVersionItem)
         paramobj = ((MMCLibVersionItem)obj).ID;
     else
         return false;
     if (paramobj == this.ID)
         return true;
     else
         return false;
 }
Exemplo n.º 5
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;
            }
        }
        public override bool Equals(object obj)
        {
            SecretKeyVersion paramobj = SecretKeyVersion.V2;

            if (obj is MMCLibVersionItem)
            {
                paramobj = ((MMCLibVersionItem)obj).ID;
            }
            else
            {
                return(false);
            }
            if (paramobj == this.ID)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
 /// <summary>
 /// CreateKeyManager method
 /// </summary>
 public ISecretKeyManager CreateInstance(SecretKeyVersion version)
 {
     return(new RSA2KeyManager.RSA2KeyManagerV2());
 }