crypto

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 16 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRandomCertificateSerialNumber

func GenerateRandomCertificateSerialNumber() (*big.Int, error)

func ReadEncryptedPEMRSAKeyFile

func ReadEncryptedPEMRSAKeyFile(path string, password []byte) (*rsa.PrivateKey, error)

func ReadPEMCertificateFile

func ReadPEMCertificateFile(path string) (*x509.Certificate, error)

func ReadPEMCertificatesFile

func ReadPEMCertificatesFile(path string) ([]*x509.Certificate, error)

func ReadPEMRSAKeyFile

func ReadPEMRSAKeyFile(path string) (*rsa.PrivateKey, error)

func SimpleSelfSignedRSAKeypair

func SimpleSelfSignedRSAKeypair(cn string, days int) (key *rsa.PrivateKey, cert *x509.Certificate, err error)

func TopicFromCert

func TopicFromCert(cert *x509.Certificate) (string, error)

TopicFromCert extracts the push certificate topic from the provided certificate.

func VerifyFromAppleDeviceCA

func VerifyFromAppleDeviceCA(c *x509.Certificate) error

VerifyFromAppleDeviceCA verifies a certificate was signed by Apple's iPhone Device CA. Manually verify the certificate since Go has deprecated verifying SHA1WithRSA x509 certificates.

func WriteEncryptedPEMRSAKeyFile

func WriteEncryptedPEMRSAKeyFile(key *rsa.PrivateKey, password []byte, path string) error

func WritePEMCertificateFile

func WritePEMCertificateFile(cert *x509.Certificate, path string) error

func WritePEMRSAKeyFile

func WritePEMRSAKeyFile(key *rsa.PrivateKey, path string) error

Types

type PKCS7Verifier added in v1.12.0

type PKCS7Verifier struct {
	// MaxSkew is the maximum amount of clock skew permitted between the the server time and the pkcs7 signature validity
	MaxSkew time.Duration
}

PKCS7Verifier verifies PKCS7 objects with a configurable clock skew

func (*PKCS7Verifier) Verify added in v1.12.0

func (v *PKCS7Verifier) Verify(p7 *pkcs7.PKCS7) error

Verify checks the signatures of a PKCS7 object

Directories

Path Synopsis
Package mdmcertutil contains helpers for requesting MDM Push Certifificates.
Package mdmcertutil contains helpers for requesting MDM Push Certifificates.
Package password provides utilities for creating and verifying macOS passwords for MDM account configuration.
Package password provides utilities for creating and verifying macOS passwords for MDM account configuration.
Package profileutil signs configuration profiles.
Package profileutil signs configuration profiles.

Jump to

Keyboard shortcuts

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