ls 4 years ago
parent
commit
eedaf1fa22
1 changed files with 4 additions and 3 deletions
  1. 4 3
      crypto.go

+ 4 - 3
crypto.go

@@ -21,11 +21,12 @@ type AesCrypto struct {
 // key/iv length:16, 24, 32 bytes to AES-128, AES-192, AES-256
 func SetAesCryptoKey(password, iv string) {
 	aesKey = password
+	aesIV = iv
 }
 
-// GetAesCryptoKey get current key
-func GetAesCryptoKey() string {
-	return aesKey
+// GetAesCryptoKey get current key/iv
+func GetAesCryptoKey() (string, string) {
+	return aesKey, aesIV
 }
 
 // NewAesCrypto new AesCrypto