privatekey

package
v3.88.12 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2025 License: AGPL-3.0 Imports: 24 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotSupported = errors.New("key type not supported")
	ErrEncryptedKey = errors.New("key is encrypted")
)
View Source
var (
	ErrUncrackable = errors.New("unable to crack encryption")
)

Functions

func Crack added in v3.88.5

func Crack(in []byte) (any, string, error)

func FingerprintPEMKey

func FingerprintPEMKey(parsedKey any) (string, error)

func Normalize added in v3.88.5

func Normalize(in string) string

func VerifyGitHubUser added in v3.88.5

func VerifyGitHubUser(ctx context.Context, parsedKey any) (*string, error)

func VerifyGitLabUser added in v3.88.5

func VerifyGitLabUser(ctx context.Context, parsedKey any) (*string, error)

Types

type DriftwoodResult

type DriftwoodResult struct {
	CertificateResults []struct {
		Domains                []string  `json:",omitempty"`
		CertificateFingerprint string    `json:"CertificateFingerprint"`
		ExpirationTimestamp    time.Time `json:"ExpirationTimestamp"`
		IssuerName             string    `json:",omitempty"` // CA information
		SubjectName            string    `json:",omitempty"` // Certificate subject
		IssuerOrganization     []string  `json:",omitempty"` // CA organization(s)
		SubjectOrganization    []string  `json:",omitempty"` // Subject organization(s)
		KeyUsages              []string  `json:",omitempty"` // e.g., ["DigitalSignature", "KeyEncipherment"]
		ExtendedKeyUsages      []string  `json:",omitempty"` // e.g., ["ServerAuth", "ClientAuth"]
		SubjectKeyID           string    `json:",omitempty"` // hex encoded
		AuthorityKeyID         string    `json:",omitempty"` // hex encoded
		SerialNumber           string    `json:",omitempty"` // hex encoded
	} `json:"CertificateResults"`
	GitHubSSHResults []struct {
		Username string `json:"Username"`
	} `json:"GitHubSSHResults"`
}

func LookupFingerprint added in v3.88.5

func LookupFingerprint(ctx context.Context, publicKeyFingerprintInHex string) (*DriftwoodResult, error)

type Scanner

type Scanner struct {
	IncludeExpired bool
}

func (Scanner) Description added in v3.82.4

func (s Scanner) Description() string

func (Scanner) FromData

func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results []detectors.Result, err error)

FromData will find and optionally verify Privatekey secrets in a given set of bytes.

func (Scanner) IsFalsePositive added in v3.75.1

func (s Scanner) IsFalsePositive(_ detectors.Result) (bool, string)

func (Scanner) Keywords

func (s Scanner) Keywords() []string

Keywords are used for efficiently pre-filtering chunks. Use identifiers in the secret preferably, or the provider name.

func (Scanner) MaxSecretSize added in v3.78.1

func (s Scanner) MaxSecretSize() int64

ProvideMaxSecretSize returns the maximum size of a secret that this detector can find.

func (Scanner) Type added in v3.27.0

func (s Scanner) Type() detectorspb.DetectorType

type VerificationErrors added in v3.88.5

type VerificationErrors struct {
	Errors []string
	// contains filtered or unexported fields
}

func NewVerificationErrors added in v3.88.5

func NewVerificationErrors(capacity int) *VerificationErrors

func (*VerificationErrors) Add added in v3.88.5

func (e *VerificationErrors) Add(err error)

Jump to

Keyboard shortcuts

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