How to use the jsencrypt/bin/jsencrypt.min.js function in jsencrypt

To help you get started, we’ve selected a few jsencrypt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WeBankFinTech / Prophecis / ui / src / views / Login.vue View on Github external
this.$refs.loginForm.validate((valid) => {
        if (valid) {
          this.disabled = true
          let params = {}
          if (this.publicKeyData) {
            const encryptor = new Jsencrypt()
            encryptor.setPublicKey(this.publicKeyData)
            const password = encryptor.encrypt(this.loginForm.password)
            params = {
              username: this.loginForm.username,
              password: password
            }
          } else {
            params = {
              username: this.loginForm.username,
              password: this.loginForm.password
            }
          }
          this.FesApi.fetch(`/cc/${this.FesEnv.ccApiVersion}/LDAPlogin`, params, 'post').then((res) => {
            this.disabled = false
            localStorage.setItem('userId', res.userName)
            res.isSuperadmin && localStorage.setItem('superAdmin', res.isSuperadmin)

jsencrypt

A Javascript library to perform OpenSSL RSA Encryption, Decryption, and Key Generation.

MIT
Latest version published 2 years ago

Package Health Score

61 / 100
Full package analysis