示例#1
0
 public CreateAuthService(IUserRepository userRepository,
                          ICryptograph cryptograph,
                          IOptions <CryptographConfig> cryptographConfig)
 {
     _userRepository = userRepository;
     _cryptograph    = cryptograph;
     _jwtSecretKey   = cryptographConfig.Value.JwtSecretKey;
 }
示例#2
0
 public CreateUserService(IUserRepository userRepository,
                          ICryptograph cryptograph,
                          IMapper mapper)
 {
     _userRepository = userRepository;
     _mapper         = mapper;
     _cryptograph    = cryptograph;
 }
示例#3
0
        public void TestCryptograph()
        {
            ICryptograph cryptograph = GetCryptograph();

            string message = "test message 123?-;A0[]";
            string encode  = cryptograph.Encode(message);
            string decode  = cryptograph.Decode(encode);

            Assert.IsTrue(message.Equals(decode));
        }
示例#4
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="repository">Repository to manage MIM Portal data</param>
        /// <param name="crypto">Cryptograph service</param>
        /// <param name="config">Configuration service</param>
        public MIMResourceAdminController(
            IResourceRepository repository,
            ICryptograph crypto,
            IConfiguration config)
        {
            this.repo          = repository;
            this.cryptograph   = crypto;
            this.configuration = config;

            this.encryptionKey =
                ConfigurationManager.GetValue <string>(this.configuration, "EncryptionKey", string.Empty);
            this.secretToken = this.cryptograph.Encrypt(this.encryptionKey, this.encryptionKey);
        }
示例#5
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="config">Configuration service</param>
 /// <param name="crypto">Cryptograph service</param>
 public GeneralController(IConfiguration config, ICryptograph crypto)
 {
     this.configuration = config;
     this.cryptograph   = crypto;
 }
示例#6
0
 public MIMResource(ICache cache, ISchema schema, ICryptograph crypto)
 {
     this.repoCache   = cache;
     this.schema      = schema;
     this.cryptograph = crypto;
 }
示例#7
0
 public CoreContext(DbContextOptions <CoreContext> options, ICryptograph cryptograph) : base(options)
 {
     _cryptograph = cryptograph;
 }