mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-10 18:05:48 +02:00
22 lines
427 B
Go
22 lines
427 B
Go
package crypto
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/0xJacky/Nginx-UI/internal/crypto"
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/uozi-tech/cosy"
|
|
)
|
|
|
|
// GetPublicKey generates a new ED25519 key pair and registers it in the cache
|
|
func GetPublicKey(c *gin.Context) {
|
|
params, err := crypto.GetCryptoParams()
|
|
if err != nil {
|
|
cosy.ErrHandler(c, err)
|
|
return
|
|
}
|
|
|
|
c.JSON(http.StatusOK, gin.H{
|
|
"public_key": params.PublicKey,
|
|
})
|
|
}
|