mirror of
https://github.com/jsiebens/ionscale.git
synced 2026-03-31 15:07:49 +01:00
feat: add id token handler
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"crypto/rsa"
|
||||
"math/rand"
|
||||
"time"
|
||||
)
|
||||
@@ -34,3 +35,14 @@ func RandomBytes(size int) ([]byte, error) {
|
||||
}
|
||||
return buf, nil
|
||||
}
|
||||
|
||||
func NewPrivateKey() (*rsa.PrivateKey, string, error) {
|
||||
id := RandStringBytes(22)
|
||||
|
||||
privateKey, err := rsa.GenerateKey(entropy, 2048)
|
||||
if err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
|
||||
return privateKey, id, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user