zitadel/internal/crypto/aes_test.go

19 lines
425 B
Go
Raw Normal View History

2020-03-23 06:06:44 +00:00
package crypto
import (
"testing"
"github.com/stretchr/testify/assert"
)
//TODO: refactor test style
2020-03-23 06:06:44 +00:00
func TestDecrypt_OK(t *testing.T) {
encryptedpw, err := EncryptAESString("ThisIsMySecretPw", "passphrasewhichneedstobe32bytes!")
assert.NoError(t, err)
decryptedpw, err := DecryptAESString(encryptedpw, "passphrasewhichneedstobe32bytes!")
assert.NoError(t, err)
assert.Equal(t, "ThisIsMySecretPw", decryptedpw)
}