mirror of
https://gitlab.melroy.org/melroy/fediresolve.git
synced 2025-06-07 20:08:57 +00:00
Fix generateRSAKey method
This commit is contained in:
parent
59ab3190b9
commit
d5e03e8a1f
1 changed files with 2 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
package resolver
|
package resolver
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"crypto/rand"
|
||||||
"crypto/rsa"
|
"crypto/rsa"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
@ -415,7 +416,7 @@ func (r *Resolver) extractPublicKey(actorData map[string]interface{}) (string, s
|
||||||
func generateRSAKey() (*rsa.PrivateKey, error) {
|
func generateRSAKey() (*rsa.PrivateKey, error) {
|
||||||
// In a real app, we would use a persistent key, but for this demo, we'll generate a new one
|
// In a real app, we would use a persistent key, but for this demo, we'll generate a new one
|
||||||
// For server-to-server communication, this is not ideal but works for demonstration purposes
|
// For server-to-server communication, this is not ideal but works for demonstration purposes
|
||||||
return rsa.GenerateKey(strings.NewReader("fediresolve-demo-random-source"), 2048)
|
return rsa.GenerateKey(rand.Reader, 2048)
|
||||||
}
|
}
|
||||||
|
|
||||||
// signRequest signs an HTTP request using HTTP Signatures
|
// signRequest signs an HTTP request using HTTP Signatures
|
||||||
|
|
Loading…
Add table
Reference in a new issue