Documentation ¶
Index ¶
- Constants
- func GenerateCertificate(logger *zap.Logger, ca tls.Certificate, req IdentityRequest) (derBytes []byte, err error)
- func GeneratePrivKey() (privKey ed25519.PublicKey, keyPem string)
- func MakeSubjectV1(id uint64, token string) pkix.Name
- func MakeSubjectV2(id uint64, hash []byte) pkix.Name
- func MarshalCertificate(derBytes []byte) (pemBytes []byte)
- func UnmarshalPrivateKey(pemBytes []byte) (ed25519.PrivateKey, error)
- type Identity
- type IdentityRequest
- type TokenVersion
Constants ¶
View Source
const ( TokenSeparator string = ":" TokenV1 TokenVersion = "v1" // CommonName: v1:clientID:oldToken before PKI is implemented, only the oldToken will be used TokenV2 TokenVersion = "v2" // CommonName: v2:clientID:base64url(sha256(public key)) initial implementation of PKI, the entire CommonName will be used )
Variables ¶
This section is empty.
Functions ¶
func GenerateCertificate ¶
func GenerateCertificate(logger *zap.Logger, ca tls.Certificate, req IdentityRequest) (derBytes []byte, err error)
func GeneratePrivKey ¶
func MarshalCertificate ¶
func UnmarshalPrivateKey ¶
func UnmarshalPrivateKey(pemBytes []byte) (ed25519.PrivateKey, error)
Types ¶
type Identity ¶
func ExtractCertificateIdentity ¶
func ExtractCertificateIdentity(cert *x509.Certificate) (*Identity, error)
func (*Identity) MarshalLogObject ¶
func (n *Identity) MarshalLogObject(enc zapcore.ObjectEncoder) error
func (*Identity) NodeIdentity ¶
type IdentityRequest ¶
type TokenVersion ¶
type TokenVersion string
Click to show internal directories.
Click to hide internal directories.