RealmKeystoreRsa

class RealmKeystoreRsa : KotlinCustomResource

Allows for creating and managing rsa Realm keystores within Keycloak. A realm keystore manages generated key pairs that are used by Keycloak to perform cryptographic signatures and encryption.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.keycloak.Realm;
import com.pulumi.keycloak.RealmArgs;
import com.pulumi.keycloak.RealmKeystoreRsa;
import com.pulumi.keycloak.RealmKeystoreRsaArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var realm = new Realm("realm", RealmArgs.builder()
.realm("my-realm")
.build());
var keystoreRsa = new RealmKeystoreRsa("keystoreRsa", RealmKeystoreRsaArgs.builder()
.name("my-rsa-key")
.realmId(realm.id())
.enabled(true)
.active(true)
.privateKey("<your rsa private key>")
.certificate("<your certificate>")
.priority(100)
.algorithm("RS256")
.keystoreSize(2048)
.providerId("rsa")
.build());
}
}
resources:
realm:
type: keycloak:Realm
properties:
realm: my-realm
keystoreRsa:
type: keycloak:RealmKeystoreRsa
name: keystore_rsa
properties:
name: my-rsa-key
realmId: ${realm.id}
enabled: true
active: true
privateKey: <your rsa private key>
certificate: <your certificate>
priority: 100
algorithm: RS256
keystoreSize: 2048
providerId: rsa

Import

Realm keys can be imported using realm name and keystore id, you can find it in web UI. Example: bash

$ pulumi import keycloak:index/realmKeystoreRsa:RealmKeystoreRsa keystore_rsa my-realm/618cfba7-49aa-4c09-9a19-2f699b576f0b

Properties

Link copied to clipboard
val active: Output<Boolean>?

When false, key in not used for signing. Defaults to true.

Link copied to clipboard
val algorithm: Output<String>?

Intended algorithm for the key. Defaults to RS256. Use RSA-OAEP for encryption keys

Link copied to clipboard
val certificate: Output<String>

X509 Certificate encoded in PEM format.

Link copied to clipboard
val enabled: Output<Boolean>?

When false, key is not accessible in this realm. Defaults to true.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val name: Output<String>

Display name of provider when linked in admin console.

Link copied to clipboard
val priority: Output<Int>?

Priority for the provider. Defaults to 0

Link copied to clipboard
val privateKey: Output<String>

Private RSA Key encoded in PEM format.

Link copied to clipboard
val providerId: Output<String>?

Use rsa for signing keys, rsa-enc for encryption keys

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val realmId: Output<String>

The realm this keystore exists in.

Link copied to clipboard
val urn: Output<String>