Apply fixes suggested by staticcheck
This commit is contained in:
parent
82c22e3969
commit
3d7a09347d
19 changed files with 26 additions and 315 deletions
|
|
@ -184,10 +184,6 @@ func StoreSSLCertOnDisk(fs file.Filesystem, name string, sslCert *ingress.SSLCer
|
|||
return nil
|
||||
}
|
||||
|
||||
func isSSLCertStoredOnDisk(sslCert *ingress.SSLCert) bool {
|
||||
return len(sslCert.PemFileName) > 0
|
||||
}
|
||||
|
||||
// ConfigureCACertWithCertAndKey appends ca into existing PEM file consisting of cert and key
|
||||
// and sets relevant fields in sslCert object
|
||||
func ConfigureCACertWithCertAndKey(fs file.Filesystem, name string, ca []byte, sslCert *ingress.SSLCert) error {
|
||||
|
|
|
|||
|
|
@ -342,19 +342,6 @@ func newSignedCert(cfg certutil.Config, key crypto.Signer, caCert *x509.Certific
|
|||
return x509.ParseCertificate(certDERBytes)
|
||||
}
|
||||
|
||||
// encodePublicKeyPEM returns PEM-encoded public data
|
||||
func encodePublicKeyPEM(key *rsa.PublicKey) ([]byte, error) {
|
||||
der, err := x509.MarshalPKIXPublicKey(key)
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
block := pem.Block{
|
||||
Type: "PUBLIC KEY",
|
||||
Bytes: der,
|
||||
}
|
||||
return pem.EncodeToMemory(&block), nil
|
||||
}
|
||||
|
||||
// encodePrivateKeyPEM returns PEM-encoded private key data
|
||||
func encodePrivateKeyPEM(key *rsa.PrivateKey) []byte {
|
||||
block := pem.Block{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue