tlsextract

package module
v0.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2019 License: MIT Imports: 4 Imported by: 0

README

tlsextract

Extract TLS metadata from connection in JSON format.

Documentation

Overview

Package tlsextract provides utilities for extracting TLS metadata from connections in a JSON-friendly format.

Index

Constants

View Source
const Version = "0.0.0"

Variables

This section is empty.

Functions

This section is empty.

Types

type Certificate

type Certificate struct {
	Signature struct {
		Algorithm string `json:"algorithm"`
		Value     []byte `json:"value"`
	} `json:"signature"`
	PublicKey struct {
		Algorithm string `json:"algorithm"`
		Value     []byte `json:"value"`
	} `json:"public_key"`
	Issuer         Name     `json:"issuer"`
	Subject        Name     `json:"subject"`
	OCSPServer     string   `json:"ocsp_server"`
	IssuingCertURL string   `json:"issuing_cert_url,omitempty"`
	DNSNames       []string `json:"dns_names,omitempty"`
}

type Metadata

type Metadata struct {
	CipherSuite uint16         `json:"cipher_suite"`
	Chain       []*Certificate `json:"chain"`
}

func FromAddr

func FromAddr(addr string) (*Metadata, error)

FromAddr returns TLS connection Metadata from domain:port address.

func FromConn

func FromConn(conn *tls.Conn) (*Metadata, error)

FromConn returns TLS connection Metadata from tls.Conn.

type Name

type Name struct {
	Country            string `json:"country,omitempty"`
	Locality           string `json:"locality,omitempty"`
	Province           string `json:"province,omitempty"`
	StreetAddress      string `json:"street_address,omitempty"`
	PostalCode         string `json:"postal_code,omitempty"`
	Organization       string `json:"organization,omitempty"`
	OrganizationalUnit string `json:"organization_unit,omitempty"`
	SerialNumber       string `json:"serial_number,omitempty"`
	CommonName         string `json:"common_name,omitempty"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL