certificate

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: ISC Imports: 7 Imported by: 1

Documentation

Overview

Package certificate is the client.Device.Certificate namespace.

For Panorama, there are two possibilities: managing this object on Panorama itself or inside of a Template.

To manage objects on Panorama, leave "tmpl" and "vsys" params empty.

To manage objects in a template, specify the template name and the vsys (if unspecified, defaults to "shared").

Configuring things such as "Forward Trust Certificate", "Forward Untrust Certificate", and "Trusted Root CA" is done from the Device.SslDecrypt namespace.

Note: PAN-OS 7.1+

Normalized object: Entry

Index

Constants

View Source
const (
	StatusValid   = "valid"
	StatusRevoked = "revoked"
)

Valid values for Entry.Status.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Name            string
	CommonName      string
	Algorithm       string
	Ca              bool
	NotValidAfter   string
	NotValidBefore  string
	ExpiryEpoch     string
	Subject         string
	SubjectHash     string
	Issuer          string
	IssuerHash      string
	Csr             string
	PublicKey       string
	PrivateKey      string
	PrivateKeyOnHsm bool
	Status          string
	RevokeDateEpoch string
}

Entry is a normalized, version independent representation of a certificate.

PAN-OS 7.1+.

func (*Entry) Copy

func (o *Entry) Copy(s Entry)

Copy copies the information from source Entry `s` to this object. As the Name field relates to the XPATH of this object, this field is not copied.

func (Entry) Specify

func (o Entry) Specify(v version.Number) (string, interface{})

type Firewall

type Firewall struct {
	// contains filtered or unexported fields
}

Firewall is the client.Device.Certificate namespace.

func FirewallNamespace

func FirewallNamespace(client util.XapiClient) *Firewall

FirewallNamespace returns an initialized namespace.

func (*Firewall) AllFromPanosConfig

func (c *Firewall) AllFromPanosConfig(vsys string) ([]Entry, error)

AllFromPanosConfig retrieves all objects stored in the retrieved config.

func (*Firewall) Delete

func (c *Firewall) Delete(vsys string, e ...interface{}) error

Delete performs DELETE to remove the specified objects.

Objects can be either a string or an Entry object.

func (*Firewall) Edit

func (c *Firewall) Edit(vsys string, e Entry) error

Edit performs EDIT to configure the specified object.

func (*Firewall) Export

func (c *Firewall) Export(format, vsys, name, passphrase string, includeKey bool, timeout time.Duration) (string, []byte, error)

Export exports a certificate.

The format param should be either "pem" or "pkcs12".

The public key is always exported.

Attempting to export a PKCS12 cert as a PEM cert will result in an error.

Return values are the filename, file contents, and an error.

func (*Firewall) FromPanosConfig

func (c *Firewall) FromPanosConfig(vsys, name string) (Entry, error)

FromPanosConfig retrieves the object stored in the retrieved config.

func (*Firewall) Get

func (c *Firewall) Get(vsys, name string) (Entry, error)

Get performs GET to retrieve information for the given object.

func (*Firewall) GetAll

func (c *Firewall) GetAll(vsys string) ([]Entry, error)

GetAll performs GET to retrieve all objects configured.

func (*Firewall) GetList

func (c *Firewall) GetList(vsys string) ([]string, error)

GetList performs GET to retrieve a list of all objects.

func (*Firewall) ImportPem

func (c *Firewall) ImportPem(vsys string, timeout time.Duration, cert Pem) error

ImportPem imports a PEM certificate.

func (*Firewall) ImportPkcs12

func (c *Firewall) ImportPkcs12(vsys string, timeout time.Duration, cert Pkcs12) error

ImportPkcs12 imports a PKCS12 certificate.

func (*Firewall) Set

func (c *Firewall) Set(vsys string, e ...Entry) error

Set performs SET to configure the specified objects.

func (*Firewall) Show

func (c *Firewall) Show(vsys, name string) (Entry, error)

Show performs SHOW to retrieve information for the given object.

func (*Firewall) ShowAll

func (c *Firewall) ShowAll(vsys string) ([]Entry, error)

ShowAll performs SHOW to retrieve information for all objects.

func (*Firewall) ShowList

func (c *Firewall) ShowList(vsys string) ([]string, error)

ShowList performs SHOW to retrieve a list of all objects.

type Panorama

type Panorama struct {
	// contains filtered or unexported fields
}

Panorama is the client.Device.Certificate namespace.

func PanoramaNamespace

func PanoramaNamespace(client util.XapiClient) *Panorama

PanoramaNamespace returns an initialized namespace.

func (*Panorama) AllFromPanosConfig

func (c *Panorama) AllFromPanosConfig(shared bool, tmpl, vsys string) ([]Entry, error)

AllFromPanosConfig retrieves all objects stored in the retrieved config.

func (*Panorama) Delete

func (c *Panorama) Delete(shared bool, tmpl, vsys string, e ...interface{}) error

Delete performs DELETE to remove the specified objects.

Objects can be either a string or an Entry object.

func (*Panorama) Edit

func (c *Panorama) Edit(shared bool, tmpl, vsys string, e Entry) error

Edit performs EDIT to configure the specified object.

func (*Panorama) Export

func (c *Panorama) Export(format, tmpl, vsys, name, passphrase string, includeKey bool, timeout time.Duration) (string, []byte, error)

Export exports a certificate.

The format param should be either "pem" or "pkcs12".

The public key is always exported.

Attempting to export a PKCS12 cert as a PEM cert will result in an error.

Return values are the filename, file contents, and an error.

func (*Panorama) FromPanosConfig

func (c *Panorama) FromPanosConfig(shared bool, tmpl, vsys, name string) (Entry, error)

FromPanosConfig retrieves the object stored in the retrieved config.

func (*Panorama) Get

func (c *Panorama) Get(shared bool, tmpl, vsys, name string) (Entry, error)

Get performs GET to retrieve information for the given object.

func (*Panorama) GetAll

func (c *Panorama) GetAll(shared bool, tmpl, vsys string) ([]Entry, error)

GetAll performs GET to retrieve all objects configured.

func (*Panorama) GetList

func (c *Panorama) GetList(shared bool, tmpl, vsys string) ([]string, error)

GetList performs GET to retrieve a list of all objects.

func (*Panorama) ImportPem

func (c *Panorama) ImportPem(tmpl, vsys string, timeout time.Duration, cert Pem) error

ImportPem imports a PEM certificate.

func (*Panorama) ImportPkcs12

func (c *Panorama) ImportPkcs12(tmpl, vsys string, timeout time.Duration, cert Pkcs12) error

ImportPkcs12 imports a PKCS12 certificate.

func (*Panorama) Set

func (c *Panorama) Set(shared bool, tmpl, vsys string, e ...Entry) error

Set performs SET to configure the specified objects.

func (*Panorama) Show

func (c *Panorama) Show(shared bool, tmpl, vsys, name string) (Entry, error)

Show performs SHOW to retrieve information for the given object.

func (*Panorama) ShowAll

func (c *Panorama) ShowAll(shared bool, tmpl, vsys string) ([]Entry, error)

ShowAll performs SHOW to retrieve information for all objects.

func (*Panorama) ShowList

func (c *Panorama) ShowList(shared bool, tmpl, vsys string) ([]string, error)

ShowList performs SHOW to retrieve a list of all objects.

type Pem

type Pem struct {
	Name                string
	Certificate         string
	CertificateFilename string
	PrivateKey          string
	PrivateKeyFilename  string
	Passphrase          string
}

Pem is a PEM certificate suitable to be imported into PAN-OS.

Importing the certificate and the private key are two separate API calls. If the PrivateKey is left unspecified, then the 2nd API call will not be made.

type Pkcs12

type Pkcs12 struct {
	Name                string
	Certificate         string
	CertificateFilename string
	Passphrase          string
}

Pkcs12 is a PKCS12 certificate suitable to be imported into PAN-OS.

Jump to

Keyboard shortcuts

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