Documentation ¶
Index ¶
- Variables
- func CompareFiles(dst, src string) (err error)
- func CreateCSR(key crypto.PrivateKey) (csr []byte, err error)
- func CreateFilePartition(path string, fsType string, size uint64, ...) (err error)
- func GenerateCACertAndKey(parent *x509.Certificate, privateKey crypto.PrivateKey, subject pkix.Name) (*x509.Certificate, crypto.PrivateKey, error)
- func GenerateCert(template, parent *x509.Certificate, privateKey crypto.PrivateKey, ...) (*x509.Certificate, error)
- func GenerateCertAndKey(template, parent *x509.Certificate, parentPrivateKey crypto.PrivateKey) (cert *x509.Certificate, privateKey crypto.PrivateKey, err error)
- func GenerateCertAndKeyWithSubject(subject pkix.Name, parent *x509.Certificate, privateKey crypto.PrivateKey) (*x509.Certificate, crypto.PrivateKey, error)
- func GenerateDefaultCARootCertAndKey() (cert *x509.Certificate, key crypto.PrivateKey, err error)
- func VerifyCertChain(leafCert *x509.Certificate, roots, intermediates []*x509.Certificate) error
- type PartDesc
- type PartInfo
- type TestDisk
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultCertificateTemplate = x509.Certificate{ SerialNumber: big.NewInt(1), Version: 3, NotBefore: time.Now().Add(-10 * time.Second), NotAfter: time.Now().AddDate(10, 0, 0), KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign | x509.KeyUsageCRLSign, ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth, x509.ExtKeyUsageServerAuth}, Subject: pkix.Name{ Country: []string{"UA"}, Organization: []string{"EPAM"}, OrganizationalUnit: []string{"Aos"}, Locality: []string{"Kyiv"}, }, DNSNames: []string{ "localhost", "wwwaosum", "*.kyiv.epam.com", "*.aos-dev.test", }, BasicConstraintsValid: true, IPAddresses: []net.IP{net.IPv4(127, 0, 0, 1).To4(), net.IPv6loopback}, }
DefaultCertificateTemplate default certificate template.
Functions ¶
func CreateCSR ¶
func CreateCSR(key crypto.PrivateKey) (csr []byte, err error)
CreateCSR creates CSR.
func CreateFilePartition ¶
func CreateFilePartition( path string, fsType string, size uint64, contentCreator func(mountPoint string) (err error), archivate bool, ) (err error)
CreateFilePartition creates partition in file.
func GenerateCACertAndKey ¶
func GenerateCACertAndKey( parent *x509.Certificate, privateKey crypto.PrivateKey, subject pkix.Name, ) (*x509.Certificate, crypto.PrivateKey, error)
GenerateCACertAndKey generates CA certificate and key.
func GenerateCert ¶
func GenerateCert( template, parent *x509.Certificate, privateKey crypto.PrivateKey, publicKey crypto.PublicKey, ) (*x509.Certificate, error)
GenerateCert generates certificate.
func GenerateCertAndKey ¶
func GenerateCertAndKey( template, parent *x509.Certificate, parentPrivateKey crypto.PrivateKey, ) (cert *x509.Certificate, privateKey crypto.PrivateKey, err error)
GenerateCertAndKey generates key and certificate.
func GenerateCertAndKeyWithSubject ¶
func GenerateCertAndKeyWithSubject( subject pkix.Name, parent *x509.Certificate, privateKey crypto.PrivateKey, ) (*x509.Certificate, crypto.PrivateKey, error)
GenerateCertAndKeyWithSubject generates certificate and key.
func GenerateDefaultCARootCertAndKey ¶
func GenerateDefaultCARootCertAndKey() (cert *x509.Certificate, key crypto.PrivateKey, err error)
GenerateDefaultCARootCertAndKey generates default CA root certificate and key.
func VerifyCertChain ¶
func VerifyCertChain(leafCert *x509.Certificate, roots, intermediates []*x509.Certificate) error
VerifyCertChain verifies chain of certificates.
Types ¶
Click to show internal directories.
Click to hide internal directories.