enhance: show the form error details of CertificateEditor

This commit is contained in:
0xJacky 2024-01-28 14:33:21 +08:00
parent 8581bdd3c6
commit b0a3989ef4
No known key found for this signature in database
GPG key ID: B6E4A6E4A561BAF0
4 changed files with 166 additions and 128 deletions

View file

@ -33,6 +33,9 @@ func IsPrivateKey(pemStr string) bool {
// IsPublicKeyPath checks if the file at the given path is a public key or not exists.
func IsPublicKeyPath(path string) bool {
if path == "" {
return false
}
_, err := os.Stat(path)
if err != nil {
@ -52,6 +55,10 @@ func IsPublicKeyPath(path string) bool {
// IsPrivateKeyPath checks if the file at the given path is a private key or not exists.
func IsPrivateKeyPath(path string) bool {
if path == "" {
return false
}
_, err := os.Stat(path)
if err != nil {