feat: add id token handler

This commit is contained in:
Johan Siebens
2022-09-27 16:13:17 +02:00
parent 7cadcc9085
commit 2e57338b54
8 changed files with 237 additions and 1 deletions
+12
View File
@@ -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
}