/*
tofuproxy -- flexible HTTP/HTTPS proxy, TLS terminator, X.509 TOFU
manager, WARC/geminispace browser
-Copyright (C) 2021-2022 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2021-2023 Sergey Matveev <stargrave@stargrave.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
import (
"crypto"
- "crypto/ecdsa"
- "crypto/elliptic"
+ "crypto/ed25519"
"crypto/rand"
"crypto/x509"
"crypto/x509/pkix"
caCert *x509.Certificate,
caPrv crypto.PrivateKey,
) *Keypair {
- prv, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
+ pub, prv, err := ed25519.GenerateKey(rand.Reader)
if err != nil {
log.Fatalln(err)
}
- pub := prv.Public()
notBefore := time.Now()
notAfter := notBefore.Add(24 * time.Hour)
Serial = Serial.Add(Serial, big.NewInt(1))