crypto_certificatekeypairs_generate_create
POST/api/v3//crypto/certificatekeypairs/generate/
Generate a new, self-signed certificate-key pair
Request
- application/json
Bodyrequired
common_namestringrequired
Possible values: non-empty
subject_alt_namestring
validity_daysintegerrequired
algAlgEnum (string)
Possible values: [rsa
, ecdsa
]
Default value:
rsa
Responses
- 200
- 400
- 403
- application/json
- Schema
- Example (auto)
Schema
pkuuidrequired
namestringrequired
fingerprint_sha256stringnullablerequired
Get certificate Hash (SHA256)
fingerprint_sha1stringnullablerequired
Get certificate Hash (SHA1)
cert_expirydate-timenullablerequired
Get certificate expiry
cert_subjectstringnullablerequired
Get certificate subject as full rfc4514
private_key_availablebooleanrequired
Show if this keypair has a private key configured or not
private_key_typestringnullablerequired
Get the private key's type, if set
certificate_download_urlstringrequired
Get URL to download certificate
private_key_download_urlstringrequired
Get URL to download private key
managedManaged by authentik (string)nullablerequired
Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update.
{
"pk": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string",
"fingerprint_sha256": "string",
"fingerprint_sha1": "string",
"cert_expiry": "2024-07-29T15:51:28.071Z",
"cert_subject": "string",
"private_key_available": true,
"private_key_type": "string",
"certificate_download_url": "string",
"private_key_download_url": "string",
"managed": "string"
}
Bad request
- application/json
- Schema
- Example (auto)
Schema
detailstringrequired
codestring
{
"detail": "string",
"code": "string"
}
Authorization: http
name: authentiktype: httpscheme: bearer
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "/api/v3/crypto/certificatekeypairs/generate/");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"common_name\": \"string\",\n \"subject_alt_name\": \"string\",\n \"validity_days\": 0,\n \"alg\": \"rsa\"\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());