Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!
openssl genrsa -des3 -out rootCA.key 4096
package main | |
import ( | |
"context" | |
"fmt" | |
"time" | |
"unsafe" | |
) | |
func main() { |
package statuscode | |
import ( | |
"fmt" | |
"strconv" | |
"strings" | |
) | |
// Code are the status codes that define the stage of the transaction | |
type Code uint |
package enum_example | |
import ( | |
"bytes" | |
"encoding/json" | |
) | |
// TaskState represents the state of task, moving through Created, Running then Finished or Errorred | |
type TaskState int |
#install FlameGraph library | |
cd /opt/ | |
sudo git clone https://github.com/brendangregg/FlameGraph.git | |
#make it accesible from any folder | |
vim ~/.bashrc | |
##add these lines anywhere and exit vim (if you can) | |
export FLAMEPATH=/opt/FlameGraph | |
PATH=$PATH:$FLAMEPATH | |
// | |
// createCertificateAuthority generates a certificate authority request ready to be signed | |
// | |
func (r *secretStore) createCertificateAuthority(names pkix.Name, expiration time.Duration, size int) (*caCertificate, error) { | |
// step: generate a keypair | |
keys, err := rsa.GenerateKey(rand.Reader, size) | |
if err != nil { | |
return nil, fmt.Errorf("unable to genarate private keys, error: %s", err) | |
} |
package main | |
import ( | |
"crypto/rand" | |
"crypto/rsa" | |
"crypto/x509" | |
"crypto/x509/pkix" | |
"encoding/pem" | |
"fmt" | |
"math/big" |
package main | |
import( | |
"log" | |
"net/url" | |
"net/http" | |
"net/http/httputil" | |
) | |
func main() { |
package main | |
import ( | |
"crypto/tls" | |
"log" | |
"net/http" | |
"net/http/httputil" | |
"net/url" | |
) |