---
name: "cdist-type__snakeoil_cert"
section: "7"
platform: "linux"
package: "cdist"
version: "7.0.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/cdist-type__snakeoil_cert"
---

# cdist-type\_\_snakeoil\_cert(7)

Generate self-signed certificate

## NAME

cdist-type\_\_snakeoil\_cert - Generate self-signed certificate

## DESCRIPTION

The purpose of this type is to generate **self-signed** certificate and private key for **testing purposes**. Certificate will expire in 3650 days.

Certificate's and key's access bits will be **644** and **640** respectively. If target system has **ssl-cert** group, then it will be used as key's group. Use **require='\_\_snakeoil\_cert/...' \_\_file ...** to override.

## OPTIONAL PARAMETERS

- **common-name**

  Defaults to **$\_\_object\_id**.

- **key-path**

  **%s** in path will be replaced with **$\_\_object\_id**. Defaults to **/etc/ssl/private/%s.pem**.

- **key-type**

  Possible values are **rsa:$bits** and **ec:$name**. For possible EC names see **openssl ecparam -list\_curves**. Defaults to **rsa:2048**.

- **cert-path**

  **%s** in path will be replaced with **$\_\_object\_id**. Defaults to **/etc/ssl/certs/%s.pem**.

## EXAMPLES

```
__snakeoil_cert localhost-rsa \
    --common-name localhost \
    --key-type rsa:4096
__snakeoil_cert localhost-ec \
    --common-name localhost \
    --key-type ec:prime256v1
```

## AUTHORS

Ander Punnar \<ander-at-kvlt-dot-ee\>

## COPYING

Copyright (C) 2021 Ander Punnar. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

## COPYRIGHT

ungleich GmbH 2021
