Separate out key directory
This commit is contained in:
parent
b7671b9a97
commit
3dfe5b8558
6 changed files with 85 additions and 60 deletions
23
sqlite_directory/create_directory.go
Normal file
23
sqlite_directory/create_directory.go
Normal file
|
@ -0,0 +1,23 @@
|
|||
package sqlite_directory
|
||||
|
||||
import (
|
||||
"crypto"
|
||||
|
||||
"crispbyte.dev/sig-auth/keydirectory"
|
||||
)
|
||||
|
||||
func CreateDirectory(alg string, publicKey crypto.PublicKey) InMemoryDirectory {
|
||||
keyDir := InMemoryDirectory{
|
||||
records: map[string]keydirectory.KeyEntry{},
|
||||
}
|
||||
|
||||
keyId := "test-id"
|
||||
|
||||
keyDir.records[keyId] = keydirectory.KeyEntry{
|
||||
Alg: alg,
|
||||
PublicKey: publicKey,
|
||||
UserId: "test_user",
|
||||
}
|
||||
|
||||
return keyDir
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue