2023-02-15 11:09:57 +01:00
|
|
|
package client
|
|
|
|
|
|
|
|
import (
|
|
|
|
"crypto/x509"
|
|
|
|
"math/big"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
type ClientCertIface interface {
|
|
|
|
Key() []byte
|
|
|
|
PEM() []byte
|
|
|
|
}
|
|
|
|
|
|
|
|
type ClientCertConfig struct {
|
|
|
|
Serial *big.Int
|
|
|
|
Subject Subject
|
|
|
|
Duration time.Duration
|
|
|
|
SubjectKeyId []byte
|
|
|
|
ExtKeyUsage []x509.ExtKeyUsage
|
|
|
|
KeyUsage x509.KeyUsage
|
|
|
|
}
|
|
|
|
|
|
|
|
type Subject struct {
|
|
|
|
Organization string
|
|
|
|
Country string
|
|
|
|
Province string
|
|
|
|
Locality string
|
|
|
|
StreetAddress string
|
|
|
|
PostalCode string
|
|
|
|
}
|
|
|
|
|
2023-03-05 00:07:48 +01:00
|
|
|
/*
|
2023-02-15 11:09:57 +01:00
|
|
|
var (
|
|
|
|
subjectKeyId = []byte{1, 2, 3, 4, 6}
|
|
|
|
extKeyUsage = []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth, x509.ExtKeyUsageServerAuth}
|
|
|
|
keyUsage = x509.KeyUsageDigitalSignature
|
|
|
|
)
|
2023-03-05 00:07:48 +01:00
|
|
|
*/
|