---
title: Charmhub | Deploy magma-orc8r-certifier using Charmhub - The Open Operator
  Collection
description: Deploy the latest version of magma-orc8r-certifier as a Kubernetes Operator
  on any cloud.
url: https://charmhub.io/magma-orc8r-certifier/libraries/cert_root_ca
---

# magma-orc8r-certifier

[Canonical Telco](https://charmhub.io/publisher/telco-charmers "View all packages from Canonical Telco")

* [Canonical Telco](https://charmhub.io/publisher/telco-charmers "View all packages from Canonical Telco")

Platform:

stable 65

```
juju deploy magma-orc8r-certifier
```

[Learn to deploy on juju >](https://juju.is/docs/juju/manage-applications)

[Toggle side navigation](https://charmhub.io/magma-orc8r-certifier/libraries/cert_root_ca#drawer)

## charms.magma\_orc8r\_certifier.v0.cert\_root\_ca

* [*Docstrings*Docstrings](https://charmhub.io/magma-orc8r-certifier/libraries/cert_root_ca)
  [*Code*Source code](https://charmhub.io/magma-orc8r-certifier/libraries/cert_root_ca/source-code)
* + Download

    Fetch library

    ```
    charmcraft fetch-lib charms.magma_orc8r_certifier.v0.cert_root_ca
    ```

    [Download cert\_root\_ca.py](https://charmhub.io/magma-orc8r-certifier/libraries/cert_root_ca/download)
  + *Last updated* 11 Jan 2023
  + *Revision* Library version 0.3

Cert RootCA Library.

This library offers ways of providing and consuming a rootCA certificate.

To get started using the library, you just need to fetch the library using `charmcraft`.

```
cd some-charm
charmcraft fetch-lib charms.magma_orc8r_certifier.v0.cert_root_ca
```

Charms providing rootCA certificate should use `CertRootCAProvides`.
Typical usage of this class would look something like:

```
```python
...
from charms.magma_orc8r_certifier.v0.cert_root_ca import CertRootCAProvides
...

class SomeProviderCharm(CharmBase):

    def __init__(self, *args):
        ...
        self.cert_root_ca = CertRootCAProvides(charm=self, relationship_name="cert-root-ca")
        ...
        self.framework.observe(
            self.cert_root_ca.on.certificate_request, self._on_certificate_request
        )

    def _on_certificate_request(self, event):
        ...
        self.cert_root_ca.set_certificate(
            relation_id=event.relation_id,
            certificate=certificate,
        )
```

And a corresponding section in charm's `metadata.yaml`:
```
provides:
    cert-root-ca:  # Relation name
        interface: cert-root-ca  # Relation interface
```
```

Charms that require rootCA certificate should use `CertRootCARequires`.
Typical usage of this class would look something like:

```
```python
...
from charms.magma_orc8r_certifier.v0.cert_root_ca import CertRootCARequires
...

class SomeRequirerCharm(CharmBase):

    def __init__(self, *args):
        ...
        self.cert_root_ca = CertRootCARequires(charm=self, relationship_name="cert-root-ca")
        ...
        self.framework.observe(
            self.cert_root_ca.on.certificate_available, self._on_certificate_available
        )

    def _on_certificate_available(self, event):
        certificate = event.certificate
        # Do something with the certificate
```

And a corresponding section in charm's `metadata.yaml`:
```
requires:
    cert-root-ca:  # Relation name
        interface: cert-root-ca  # Relation interface
```
```

---

Index

* [class CertificateRequestEvent](https://charmhub.io/magma-orc8r-certifier/libraries/cert_root_ca#certificaterequestevent)
* + [def \_\_init\_\_(
    self,
    handle,
    relation\_id)](https://charmhub.io/magma-orc8r-certifier/libraries/cert_root_ca#certificaterequestevent-__init__)
* + [def snapshot(
    self)](https://charmhub.io/magma-orc8r-certifier/libraries/cert_root_ca#certificaterequestevent-snapshot)
* + [def restore(
    self,
    snapshot)](https://charmhub.io/magma-orc8r-certifier/libraries/cert_root_ca#certificaterequestevent-restore)
* [class CertRootCAProviderCharmEvents](https://charmhub.io/magma-orc8r-certifier/libraries/cert_root_ca#certrootcaprovidercharmevents)
* [class CertRootCAProvides](https://charmhub.io/magma-orc8r-certifier/libraries/cert_root_ca#certrootcaprovides)
* + [def \_\_init\_\_(
    self,
    charm,
    relationship\_name)](https://charmhub.io/magma-orc8r-certifier/libraries/cert_root_ca#certrootcaprovides-__init__)
* + [def set\_certificate(
    self,
    relation\_id,
    certificate)](https://charmhub.io/magma-orc8r-certifier/libraries/cert_root_ca#certrootcaprovides-set_certificate)
* [class CertificateAvailableEvent](https://charmhub.io/magma-orc8r-certifier/libraries/cert_root_ca#certificateavailableevent)
* + [def \_\_init\_\_(
    self,
    handle,
    certificate)](https://charmhub.io/magma-orc8r-certifier/libraries/cert_root_ca#certificateavailableevent-__init__)
* + [def snapshot(
    self)](https://charmhub.io/magma-orc8r-certifier/libraries/cert_root_ca#certificateavailableevent-snapshot)
* + [def restore(
    self,
    snapshot)](https://charmhub.io/magma-orc8r-certifier/libraries/cert_root_ca#certificateavailableevent-restore)
* [class CertRootCARequirerCharmEvents](https://charmhub.io/magma-orc8r-certifier/libraries/cert_root_ca#certrootcarequirercharmevents)
* [class CertRootCARequires](https://charmhub.io/magma-orc8r-certifier/libraries/cert_root_ca#certrootcarequires)
* + [def \_\_init\_\_(
    self,
    charm,
    relationship\_name)](https://charmhub.io/magma-orc8r-certifier/libraries/cert_root_ca#certrootcarequires-__init__)

#### class CertificateRequestEvent

Description

Dataclass for Certificate request events. None

Methods

CertificateRequestEvent.
\_\_init\_\_(

*self*

,
handle

,
relation\_id: int
)

Description

Sets relation id. None

CertificateRequestEvent.
snapshot(

*self*
)

Description

Returns event data. None

CertificateRequestEvent.
restore(

*self*

,
snapshot
)

Description

Restores event data. None

#### class CertRootCAProviderCharmEvents

Description

All custom events for the CertRootProvider. None

#### class CertRootCAProvides

Description

Class to be instantiated by provider of root certificate. None

Methods

CertRootCAProvides.
\_\_init\_\_(

*self*

,
charm: CharmBase

,
relationship\_name: str
)

Observes relation joined event.

Arguments

charm

Juju charm

relationship\_name
(str)

Relation name

CertRootCAProvides.
set\_certificate(

*self*

,
relation\_id: int

,
certificate: str
)

Sets private key in relation data.

Arguments

relation\_id
(str)

Relation ID

certificate
(str)

Certificate

Returns

None

#### class CertificateAvailableEvent

Description

Dataclass for Certificate available events. None

Methods

CertificateAvailableEvent.
\_\_init\_\_(

*self*

,
handle

,
certificate: str
)

Description

Sets certificate. None

CertificateAvailableEvent.
snapshot(

*self*
)

Description

Returns event data. None

CertificateAvailableEvent.
restore(

*self*

,
snapshot
)

Description

Restores event data. None

#### class CertRootCARequirerCharmEvents

Description

All custom events for the CertRootRequirer. None

#### class CertRootCARequires

Description

Class to be instantiated by requirer of rootCA certificate. None

Methods

CertRootCARequires.
\_\_init\_\_(

*self*

,
charm: CharmBase

,
relationship\_name: str
)

Observes relation joined and relation changed events.

Arguments

charm

Juju charm

relationship\_name
(str)

Relation name
