certificateutil

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: MIT Imports: 17 Imported by: 34

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CeritifcateFromPemContent

func CeritifcateFromPemContent(content []byte) (*x509.Certificate, error)

CeritifcateFromPemContent ...

func CertificateFromDERContent

func CertificateFromDERContent(content []byte) (*x509.Certificate, error)

CertificateFromDERContent ...

func CheckValidity

func CheckValidity(certificate x509.Certificate) error

CheckValidity ...

func GenerateTestCertificate

func GenerateTestCertificate(serial int64, teamID, teamName, commonName string, expiry time.Time) (*x509.Certificate, *rsa.PrivateKey, error)

GenerateTestCertificate creates a certificate (signed by a self-signed CA cert) for test purposes

func InstalledCodesigningCertificateNames

func InstalledCodesigningCertificateNames() ([]string, error)

InstalledCodesigningCertificateNames ...

func InstalledCodesigningCertificates

func InstalledCodesigningCertificates() ([]*x509.Certificate, error)

InstalledCodesigningCertificates ...

func InstalledMacAppStoreCertificateNames

func InstalledMacAppStoreCertificateNames() ([]string, error)

InstalledMacAppStoreCertificateNames ...

func InstalledMacAppStoreCertificates

func InstalledMacAppStoreCertificates() ([]*x509.Certificate, error)

InstalledMacAppStoreCertificates ...

Types

type CertificateInfoModel

type CertificateInfoModel struct {
	CommonName string
	TeamName   string
	TeamID     string
	EndDate    time.Time
	StartDate  time.Time

	Serial          string
	SHA1Fingerprint string

	Certificate x509.Certificate
	PrivateKey  interface{}
}

CertificateInfoModel ...

func CertificatesFromPKCS12Content

func CertificatesFromPKCS12Content(content []byte, password string) ([]CertificateInfoModel, error)

CertificatesFromPKCS12Content returns an array of CertificateInfoModel Used to parse p12 file containing multiple codesign identities (exported from macOS Keychain)

func CertificatesFromPKCS12File

func CertificatesFromPKCS12File(pkcs12Pth, password string) ([]CertificateInfoModel, error)

CertificatesFromPKCS12File ...

func FilterCertificateInfoModelsByFilterFunc

func FilterCertificateInfoModelsByFilterFunc(certificates []CertificateInfoModel, filterFunc func(certificate CertificateInfoModel) bool) []CertificateInfoModel

FilterCertificateInfoModelsByFilterFunc ...

func InstalledCodesigningCertificateInfos

func InstalledCodesigningCertificateInfos() ([]CertificateInfoModel, error)

InstalledCodesigningCertificateInfos ...

func InstalledInstallerCertificateInfos

func InstalledInstallerCertificateInfos() ([]CertificateInfoModel, error)

InstalledInstallerCertificateInfos ...

func NewCertificateInfo

func NewCertificateInfo(certificate x509.Certificate, privateKey interface{}) CertificateInfoModel

NewCertificateInfo ...

func (CertificateInfoModel) CheckValidity

func (info CertificateInfoModel) CheckValidity() error

CheckValidity ...

func (CertificateInfoModel) EncodeToP12

func (info CertificateInfoModel) EncodeToP12(passphrase string) ([]byte, error)

EncodeToP12 encodes a CertificateInfoModel in pkcs12 (.p12) format.

func (CertificateInfoModel) String

func (info CertificateInfoModel) String() string

String ...

type ValidCertificateInfo

type ValidCertificateInfo struct {
	ValidCertificates,
	InvalidCertificates,
	DuplicatedCertificates []CertificateInfoModel
}

ValidCertificateInfo contains the certificate infos filtered as valid, invalid and duplicated common name certificates

func FilterValidCertificateInfos

func FilterValidCertificateInfos(certificateInfos []CertificateInfoModel) ValidCertificateInfo

FilterValidCertificateInfos filters out invalid and duplicated common name certificaates

Jump to

Keyboard shortcuts

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