Ejemplo n.º 1
0
 public Authenticator(IConnection connection, OmniSecureConnectionType type, OmniDigitalSignature?digitalSignature, IBytesPool bytesPool)
 {
     _connection       = connection;
     _type             = type;
     _digitalSignature = digitalSignature;
     _bytesPool        = bytesPool;
 }
Ejemplo n.º 2
0
        public SecureConnection(IConnection connection, OmniSecureConnectionOptions options)
        {
            _connection = connection ?? throw new ArgumentNullException(nameof(connection));

            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }
            if (!EnumHelper.IsValid(options.Type))
            {
                throw new ArgumentException(nameof(options.Type));
            }

            _type      = options.Type;
            _passwords = options.Passwords ?? Array.Empty <string>();
            _bytesPool = options.BufferPool ?? BytesPool.Shared;
        }
Ejemplo n.º 3
0
        public OmniSecureConnection(IConnection connection, OmniSecureConnectionOptions options)
        {
            if (connection == null)
            {
                throw new ArgumentNullException(nameof(connection));
            }
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }
            if (!EnumHelper.IsValid(options.Type))
            {
                throw new ArgumentException(nameof(options.Type));
            }

            _connection = connection;
            _type       = options.Type;
            _passwords  = new ReadOnlyCollection <string>(options.Passwords ?? Array.Empty <string>());
            _bufferPool = options.BufferPool ?? BufferPool.Shared;
        }