MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / TestInitLocalKeyPair_error

Function TestInitLocalKeyPair_error

crypto/kms/privatekeystore_test.go:156–171  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

154}
155
156func TestInitLocalKeyPair_error(t *testing.T) {
157 Convey("hash not match", t, func() {
158 defer os.Remove("./.HashNotMatch")
159 enc, _ := symmetric.EncryptWithPassword(bytes.Repeat([]byte("a"), 64), []byte(password), []byte(salt))
160 ioutil.WriteFile("./.HashNotMatch", enc, 0600)
161 err := InitLocalKeyPair("./.HashNotMatch", []byte(password))
162 So(err, ShouldEqual, ErrHashNotMatch)
163 })
164 Convey("ErrNotKeyFile", t, func() {
165 defer os.Remove("./.ErrNotKeyFile")
166 enc, _ := symmetric.EncryptWithPassword(bytes.Repeat([]byte("a"), 65), []byte(password), []byte(salt))
167 ioutil.WriteFile("./.ErrNotKeyFile", enc, 0600)
168 err := InitLocalKeyPair("./.ErrNotKeyFile", []byte(password))
169 So(err, ShouldEqual, ErrNotKeyFile)
170 })
171}

Callers

nothing calls this directly

Calls 3

EncryptWithPasswordFunction · 0.92
InitLocalKeyPairFunction · 0.85
RemoveMethod · 0.45

Tested by

no test coverage detected