Add some registration validation

This commit is contained in:
cheddar 2025-02-20 23:00:04 -05:00
parent 001a4b4ac5
commit a2cf1d6b7b
No known key found for this signature in database
2 changed files with 23 additions and 0 deletions

17
server/validation.go Normal file
View 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
}
}