18 lines
259 B
Go
18 lines
259 B
Go
|
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
|
||
|
}
|
||
|
}
|