mirror of
https://github.com/ProtonMail/go-proton-api.git
synced 2025-12-23 23:57:50 -05:00
23 lines
439 B
Go
23 lines
439 B
Go
package server
|
|
|
|
import (
|
|
"github.com/ProtonMail/go-proton-api/server/backend"
|
|
"github.com/ProtonMail/gopenpgp/v2/crypto"
|
|
)
|
|
|
|
func init() {
|
|
key, err := crypto.GenerateKey("name", "email", "rsa", 1024)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
backend.GenerateKey = func(_, _ string, passphrase []byte, _ string, _ int) (string, error) {
|
|
encKey, err := key.Lock(passphrase)
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
|
|
return encKey.Armor()
|
|
}
|
|
}
|