cryptoinfo

package
v0.11.25 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package cryptoinfo is designed to examine keys and certificates on disk, and return information about them. It is designed to work with dataflatten, and may eventually it may replace pkg/keyidentifier

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyInfo

type KeyInfo struct {
	Type     kiType
	Encoding kiEncoding
	Data     interface{}
	DataName kiDataNames
	Error    error
	Headers  map[string]string
}

func Identify

func Identify(data []byte, password string) ([]*KeyInfo, error)

Identify examines a []byte and attempts to descern what cryptographic material is contained within.

func NewCaCertificate

func NewCaCertificate(encoding kiEncoding) *KeyInfo

func NewCertificate

func NewCertificate(encoding kiEncoding) *KeyInfo

func NewError

func NewError(encoding kiEncoding, err error) *KeyInfo

func NewKey

func NewKey(encoding kiEncoding) *KeyInfo

func (*KeyInfo) MarshalJSON

func (ki *KeyInfo) MarshalJSON() ([]byte, error)

MarshalJSON is used by the go json marshaller. Using a custom one here allows us a high degree of control over the resulting output. For example, it allows us to use the same struct here to encapsulate both keys and certificate, and still have somewhat differenciated output

func (*KeyInfo) SetData

func (ki *KeyInfo) SetData(data interface{}, err error) *KeyInfo

func (*KeyInfo) SetDataName

func (ki *KeyInfo) SetDataName(name kiDataNames) *KeyInfo

func (*KeyInfo) SetHeaders

func (ki *KeyInfo) SetHeaders(headers map[string]string) *KeyInfo

Jump to

Keyboard shortcuts

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