Add some registration validation
This commit is contained in:
parent
001a4b4ac5
commit
a2cf1d6b7b
2 changed files with 23 additions and 0 deletions
17
server/validation.go
Normal file
17
server/validation.go
Normal file
|
@ -0,0 +1,17 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"crypto"
|
||||
"crypto/ecdsa"
|
||||
"crypto/ed25519"
|
||||
"crypto/rsa"
|
||||
)
|
||||
|
||||
func isValidKeyType(key crypto.PublicKey) bool {
|
||||
switch key.(type) {
|
||||
case ed25519.PublicKey, *rsa.PublicKey, *ecdsa.PublicKey:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue