listkeys

package
v0.0.0-...-2fc75eb Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2019 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListPairs

func ListPairs(dir string) (map[string]KeyPair, error)

ListPairs returns a slice of KeyPairList objects read from given directory or error

Types

type KeyPair

type KeyPair struct {
	SerialNumber   *big.Int
	SubjectNames   []pkix.AttributeTypeAndValue
	Issuer         []pkix.AttributeTypeAndValue
	PublicKey      *rsa.PublicKey
	HavePrivateKey bool
	NotValidBefore time.Time
	NotValidAfter  time.Time
}

KeyPair is a record of an x509 certificate wrapping a pubkey and a matching private key

func ReadKeyPair

func ReadKeyPair(filePath string) (*KeyPair, error)

func (KeyPair) SerialOctet

func (k KeyPair) SerialOctet() string

func (KeyPair) SimpleIssuer

func (k KeyPair) SimpleIssuer() string

func (KeyPair) SimpleSubjectNames

func (k KeyPair) SimpleSubjectNames() map[string]interface{}

func (KeyPair) String

func (k KeyPair) String() string

func (KeyPair) ToKeyPairSimple

func (k KeyPair) ToKeyPairSimple(includeRaw bool) (*KeyPairSimple, error)

type KeyPairSimple

type KeyPairSimple struct {
	Type           string                 `json:"type"`
	SerialNumber   string                 `json:"serial_number"`
	SubjectNames   map[string]interface{} `json:"subject_names"`
	HavePrivateKey bool                   `json:"have_private_key"`
	NotValidBefore time.Time              `json:"not_valid_before"`
	NotValidAfter  time.Time              `json:"not_valid_after"`
	PublicKey      string                 `json:"public_key"`
	RawKeyPair     KeyPair                `json:"_raw_key_pair,omitempty"`
}

KeyPairSimple is a KeyPair serializable struct meant to aid generating pretty output in JSON

Jump to

Keyboard shortcuts

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