MCPcopy Create free account
hub / github.com/actiontech/dtle / DecryptPassword

Function DecryptPassword

api/handler/common.go:157–174  ·  view source on GitHub ↗
(password string, rsaPrivateKey string)

Source from the content-addressed store, hash-verified

155}
156
157func DecryptPassword(password string, rsaPrivateKey string) (realPwd string, err error) {
158 if "" == rsaPrivateKey {
159 return "", fmt.Errorf("rsa private key should not be empty")
160 }
161
162 realPwdByte := []byte{}
163 realPwdByte, err = base64.StdEncoding.DecodeString(password)
164 if err != nil {
165 return "", err
166 }
167
168 realPwdByte, err = rsaDecrypt(realPwdByte, rsaPrivateKey)
169 if err != nil {
170 return "", err
171 }
172 realPwd = string(realPwdByte)
173 return realPwd, nil
174}
175
176func IsEmpty(value interface{}) bool {
177 switch value.(type) {

Callers 8

createOrUpdateJobFunction · 0.92
listOracleSchemaFunction · 0.92
ListDatabaseColumnsV2Function · 0.92
buildMysqlUriFunction · 0.92
connectDatabaseFunction · 0.92
decryptMySQLPwdFunction · 0.92

Calls 1

rsaDecryptFunction · 0.85

Tested by

no test coverage detected