---
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_bootstrapper
---

# 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_bootstrapper#drawer)

## charms.magma\_orc8r\_certifier.v0.cert\_bootstrapper

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

    Fetch library

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

    [Download cert\_bootstrapper.py](https://charmhub.io/magma-orc8r-certifier/libraries/cert_bootstrapper/download)
  + *Last updated* 13 Jul 2022
  + *Revision* Library version 0.2

Cert Bootstrapper Library.

##### Getting started

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

###### Requirer Charm

```
class CertBootstrapperRequires(Object):

    on = CertBootstrapperRequirerCharmEvents()

    def __init__(self, charm, relationship_name: str):
        self.relationship_name = relationship_name
        self.charm = charm
        super().__init__(charm, relationship_name)
        self.framework.observe(
            charm.on[relationship_name].relation_joined, self._on_relation_changed
        )
        self.framework.observe(
            charm.on[relationship_name].relation_changed, self._on_relation_changed
        )

    def _on_relation_changed(self, event):
        relation_data = event.relation.data
        private_key = relation_data[event.unit].get("private_key")
        self.on.private_key_available.emit(private_key=private_key)
```

---

Index

* [class CertificateRequestEvent](https://charmhub.io/magma-orc8r-certifier/libraries/cert_bootstrapper#certificaterequestevent)
* + [def \_\_init\_\_(
    self,
    handle,
    relation\_id)](https://charmhub.io/magma-orc8r-certifier/libraries/cert_bootstrapper#certificaterequestevent-__init__)
* + [def snapshot(
    self)](https://charmhub.io/magma-orc8r-certifier/libraries/cert_bootstrapper#certificaterequestevent-snapshot)
* + [def restore(
    self,
    snapshot)](https://charmhub.io/magma-orc8r-certifier/libraries/cert_bootstrapper#certificaterequestevent-restore)
* [class PrivateKeyAvailableEvent](https://charmhub.io/magma-orc8r-certifier/libraries/cert_bootstrapper#privatekeyavailableevent)
* + [def \_\_init\_\_(
    self,
    handle,
    private\_key)](https://charmhub.io/magma-orc8r-certifier/libraries/cert_bootstrapper#privatekeyavailableevent-__init__)
* + [def snapshot(
    self)](https://charmhub.io/magma-orc8r-certifier/libraries/cert_bootstrapper#privatekeyavailableevent-snapshot)
* + [def restore(
    self,
    snapshot)](https://charmhub.io/magma-orc8r-certifier/libraries/cert_bootstrapper#privatekeyavailableevent-restore)
* [class CertBootstrapperProviderCharmEvents](https://charmhub.io/magma-orc8r-certifier/libraries/cert_bootstrapper#certbootstrapperprovidercharmevents)
* [class CertBootstrapperRequirerCharmEvents](https://charmhub.io/magma-orc8r-certifier/libraries/cert_bootstrapper#certbootstrapperrequirercharmevents)
* [class CertBootstrapperProvides](https://charmhub.io/magma-orc8r-certifier/libraries/cert_bootstrapper#certbootstrapperprovides)
* + [def \_\_init\_\_(
    self,
    charm,
    relationship\_name)](https://charmhub.io/magma-orc8r-certifier/libraries/cert_bootstrapper#certbootstrapperprovides-__init__)
* + [def set\_private\_key(
    self,
    relation\_id,
    private\_key)](https://charmhub.io/magma-orc8r-certifier/libraries/cert_bootstrapper#certbootstrapperprovides-set_private_key)
* [class CertBootstrapperRequires](https://charmhub.io/magma-orc8r-certifier/libraries/cert_bootstrapper#certbootstrapperrequires)
* + [def \_\_init\_\_(
    self,
    charm,
    relationship\_name)](https://charmhub.io/magma-orc8r-certifier/libraries/cert_bootstrapper#certbootstrapperrequires-__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 PrivateKeyAvailableEvent

Description

Dataclass for Certificate available events. None

Methods

PrivateKeyAvailableEvent.
\_\_init\_\_(

*self*

,
handle

,
private\_key: str
)

Description

Sets private key. None

PrivateKeyAvailableEvent.
snapshot(

*self*
)

Description

Returns event data. None

PrivateKeyAvailableEvent.
restore(

*self*

,
snapshot
)

Description

Restores event data. None

#### class CertBootstrapperProviderCharmEvents

Description

All custom events for the CertBootstrapperProvider. None

#### class CertBootstrapperRequirerCharmEvents

Description

All custom events for the CertBootstrapperRequirer. None

#### class CertBootstrapperProvides

Description

Class to be instantiated by provider of bootstrapper private key. None

Methods

CertBootstrapperProvides.
\_\_init\_\_(

*self*

,
charm: CharmBase

,
relationship\_name: str
)

Observes relation joined event.

Arguments

charm

Juju charm

relationship\_name
(str)

Relation name

CertBootstrapperProvides.
set\_private\_key(

*self*

,
relation\_id: int

,
private\_key: str
)

Sets private key in relation data.

Arguments

relation\_id
(str)

Relation ID

private\_key
(str)

Private Key

Returns

None

#### class CertBootstrapperRequires

Description

Class to be instantiated by requirer of bootstrapper private key. None

Methods

CertBootstrapperRequires.
\_\_init\_\_(

*self*

,
charm: CharmBase

,
relationship\_name: str
)

Observes relation joined and relation changed events.

Arguments

charm

Juju charm

relationship\_name
(str)

Relation name
