Documentation ¶
Index ¶
- func CeritifcateFromPemContent(content []byte) (*x509.Certificate, error)
- func CertificateFromDERContent(content []byte) (*x509.Certificate, error)
- func CheckValidity(certificate x509.Certificate) error
- func GenerateTestCertificate(serial int64, teamID, teamName, commonName string, expiry time.Time) (*x509.Certificate, *rsa.PrivateKey, error)
- func InstalledCodesigningCertificateNames() ([]string, error)
- func InstalledCodesigningCertificates() ([]*x509.Certificate, error)
- func InstalledMacAppStoreCertificateNames() ([]string, error)
- func InstalledMacAppStoreCertificates() ([]*x509.Certificate, error)
- type CertificateInfoModel
- func CertificatesFromPKCS12Content(content []byte, password string) ([]CertificateInfoModel, error)
- func CertificatesFromPKCS12File(pkcs12Pth, password string) ([]CertificateInfoModel, error)
- func FilterCertificateInfoModelsByFilterFunc(certificates []CertificateInfoModel, ...) []CertificateInfoModel
- func InstalledCodesigningCertificateInfos() ([]CertificateInfoModel, error)
- func InstalledInstallerCertificateInfos() ([]CertificateInfoModel, error)
- func NewCertificateInfo(certificate x509.Certificate, privateKey interface{}) CertificateInfoModel
- type ValidCertificateInfo
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 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 ¶
InstalledCodesigningCertificateNames ...
func InstalledCodesigningCertificates ¶
func InstalledCodesigningCertificates() ([]*x509.Certificate, error)
InstalledCodesigningCertificates ...
func InstalledMacAppStoreCertificateNames ¶
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.
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