1. Registry
  2. Packages
  3. Keycloak Provider
  4. API Docs
  5. RealmKeystoreRsaEncGenerated
Viewing docs for Keycloak v6.14.1
published on Tuesday, Oct 13, 2026 by Pulumi
keycloak logo keycloak logo
Viewing docs for Keycloak v6.14.1
published on Tuesday, Oct 13, 2026 by Pulumi

    Allows for creating and managing rsa-enc-generated Realm keystores within Keycloak.

    A realm keystore manages generated key pairs that are used by Keycloak to perform encryption.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as keycloak from "@pulumi/keycloak";
    
    const realm = new keycloak.Realm("realm", {realm: "my-realm"});
    const keystoreRsaEncGenerated = new keycloak.RealmKeystoreRsaEncGenerated("keystore_rsa_enc_generated", {
        name: "my-rsa-enc-generated-key",
        realmId: realm.id,
        enabled: true,
        active: true,
        priority: 100,
        algorithm: "RSA-OAEP",
        keySize: 2048,
    });
    
    import pulumi
    import pulumi_keycloak as keycloak
    
    realm = keycloak.Realm("realm", realm="my-realm")
    keystore_rsa_enc_generated = keycloak.RealmKeystoreRsaEncGenerated("keystore_rsa_enc_generated",
        name="my-rsa-enc-generated-key",
        realm_id=realm.id,
        enabled=True,
        active=True,
        priority=100,
        algorithm="RSA-OAEP",
        key_size=2048)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-keycloak/sdk/v6/go/keycloak"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		realm, err := keycloak.NewRealm(ctx, "realm", &keycloak.RealmArgs{
    			Realm: pulumi.String("my-realm"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = keycloak.NewRealmKeystoreRsaEncGenerated(ctx, "keystore_rsa_enc_generated", &keycloak.RealmKeystoreRsaEncGeneratedArgs{
    			Name:      pulumi.String("my-rsa-enc-generated-key"),
    			RealmId:   realm.ID().ToIDOutput().ToStringOutput(),
    			Enabled:   pulumi.Bool(true),
    			Active:    pulumi.Bool(true),
    			Priority:  pulumi.Int(100),
    			Algorithm: pulumi.String("RSA-OAEP"),
    			KeySize:   pulumi.Int(2048),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Keycloak = Pulumi.Keycloak;
    
    return await Deployment.RunAsync(() => 
    {
        var realm = new Keycloak.Realm("realm", new()
        {
            RealmName = "my-realm",
        });
    
        var keystoreRsaEncGenerated = new Keycloak.RealmKeystoreRsaEncGenerated("keystore_rsa_enc_generated", new()
        {
            Name = "my-rsa-enc-generated-key",
            RealmId = realm.Id,
            Enabled = true,
            Active = true,
            Priority = 100,
            Algorithm = "RSA-OAEP",
            KeySize = 2048,
        });
    
    });
    
    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.RealmKeystoreRsaEncGenerated;
    import com.pulumi.keycloak.RealmKeystoreRsaEncGeneratedArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 keystoreRsaEncGenerated = new RealmKeystoreRsaEncGenerated("keystoreRsaEncGenerated", RealmKeystoreRsaEncGeneratedArgs.builder()
                .name("my-rsa-enc-generated-key")
                .realmId(realm.id())
                .enabled(true)
                .active(true)
                .priority(100)
                .algorithm("RSA-OAEP")
                .keySize(2048)
                .build());
    
        }
    }
    
    resources:
      realm:
        type: keycloak:Realm
        properties:
          realm: my-realm
      keystoreRsaEncGenerated:
        type: keycloak:RealmKeystoreRsaEncGenerated
        name: keystore_rsa_enc_generated
        properties:
          name: my-rsa-enc-generated-key
          realmId: ${realm.id}
          enabled: true
          active: true
          priority: 100
          algorithm: RSA-OAEP
          keySize: 2048
    
    terraform {
      required_providers {
        keycloak = {
          source = "pulumi/keycloak"
        }
      }
    }
    
    resource "keycloak_realm" "realm" {
      lifecycle {
        create_before_destroy = true
      }
      realm = "my-realm"
    }
    resource "keycloak_realm_keystore_rsa_enc_generated" "keystore_rsa_enc_generated" {
      lifecycle {
        create_before_destroy = true
      }
      name      = "my-rsa-enc-generated-key"
      realm_id  = keycloak_realm.realm.id
      enabled   = true
      active    = true
      priority  = 100
      algorithm = "RSA-OAEP"
      key_size  = 2048
    }
    

    Create RealmKeystoreRsaEncGenerated Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new RealmKeystoreRsaEncGenerated(name: string, args: RealmKeystoreRsaEncGeneratedArgs, opts?: CustomResourceOptions);
    @overload
    def RealmKeystoreRsaEncGenerated(resource_name: str,
                                     args: RealmKeystoreRsaEncGeneratedArgs,
                                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def RealmKeystoreRsaEncGenerated(resource_name: str,
                                     opts: Optional[ResourceOptions] = None,
                                     realm_id: Optional[str] = None,
                                     active: Optional[bool] = None,
                                     algorithm: Optional[str] = None,
                                     enabled: Optional[bool] = None,
                                     key_size: Optional[int] = None,
                                     name: Optional[str] = None,
                                     priority: Optional[int] = None)
    func NewRealmKeystoreRsaEncGenerated(ctx *Context, name string, args RealmKeystoreRsaEncGeneratedArgs, opts ...ResourceOption) (*RealmKeystoreRsaEncGenerated, error)
    public RealmKeystoreRsaEncGenerated(string name, RealmKeystoreRsaEncGeneratedArgs args, CustomResourceOptions? opts = null)
    public RealmKeystoreRsaEncGenerated(String name, RealmKeystoreRsaEncGeneratedArgs args)
    public RealmKeystoreRsaEncGenerated(String name, RealmKeystoreRsaEncGeneratedArgs args, CustomResourceOptions options)
    
    type: keycloak:RealmKeystoreRsaEncGenerated
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "keycloak_realm_keystore_rsa_enc_generated" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args RealmKeystoreRsaEncGeneratedArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args RealmKeystoreRsaEncGeneratedArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args RealmKeystoreRsaEncGeneratedArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RealmKeystoreRsaEncGeneratedArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RealmKeystoreRsaEncGeneratedArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var realmKeystoreRsaEncGeneratedResource = new Keycloak.RealmKeystoreRsaEncGenerated("realmKeystoreRsaEncGeneratedResource", new()
    {
        RealmId = "string",
        Active = false,
        Algorithm = "string",
        Enabled = false,
        KeySize = 0,
        Name = "string",
        Priority = 0,
    });
    
    example, err := keycloak.NewRealmKeystoreRsaEncGenerated(ctx, "realmKeystoreRsaEncGeneratedResource", &keycloak.RealmKeystoreRsaEncGeneratedArgs{
    	RealmId:   pulumi.String("string"),
    	Active:    pulumi.Bool(false),
    	Algorithm: pulumi.String("string"),
    	Enabled:   pulumi.Bool(false),
    	KeySize:   pulumi.Int(0),
    	Name:      pulumi.String("string"),
    	Priority:  pulumi.Int(0),
    })
    
    resource "keycloak_realm_keystore_rsa_enc_generated" "realmKeystoreRsaEncGeneratedResource" {
      lifecycle {
        create_before_destroy = true
      }
      realm_id  = "string"
      active    = false
      algorithm = "string"
      enabled   = false
      key_size  = 0
      name      = "string"
      priority  = 0
    }
    
    var realmKeystoreRsaEncGeneratedResource = new RealmKeystoreRsaEncGenerated("realmKeystoreRsaEncGeneratedResource", RealmKeystoreRsaEncGeneratedArgs.builder()
        .realmId("string")
        .active(false)
        .algorithm("string")
        .enabled(false)
        .keySize(0)
        .name("string")
        .priority(0)
        .build());
    
    realm_keystore_rsa_enc_generated_resource = keycloak.RealmKeystoreRsaEncGenerated("realmKeystoreRsaEncGeneratedResource",
        realm_id="string",
        active=False,
        algorithm="string",
        enabled=False,
        key_size=0,
        name="string",
        priority=0)
    
    const realmKeystoreRsaEncGeneratedResource = new keycloak.RealmKeystoreRsaEncGenerated("realmKeystoreRsaEncGeneratedResource", {
        realmId: "string",
        active: false,
        algorithm: "string",
        enabled: false,
        keySize: 0,
        name: "string",
        priority: 0,
    });
    
    type: keycloak:RealmKeystoreRsaEncGenerated
    properties:
        active: false
        algorithm: string
        enabled: false
        keySize: 0
        name: string
        priority: 0
        realmId: string
    

    RealmKeystoreRsaEncGenerated Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The RealmKeystoreRsaEncGenerated resource accepts the following input properties:

    RealmId string
    The realm this keystore exists in.
    Active bool
    When false, key is not used for encryption. Defaults to true.
    Algorithm string
    Intended algorithm for the key. Defaults to RSA-OAEP
    Enabled bool
    When false, key is not accessible in this realm. Defaults to true.
    KeySize int
    Size for the generated keys. Defaults to 2048.
    Name string
    Display name of provider when linked in admin console.
    Priority int
    Priority for the provider. Defaults to 0
    RealmId string
    The realm this keystore exists in.
    Active bool
    When false, key is not used for encryption. Defaults to true.
    Algorithm string
    Intended algorithm for the key. Defaults to RSA-OAEP
    Enabled bool
    When false, key is not accessible in this realm. Defaults to true.
    KeySize int
    Size for the generated keys. Defaults to 2048.
    Name string
    Display name of provider when linked in admin console.
    Priority int
    Priority for the provider. Defaults to 0
    realm_id string
    The realm this keystore exists in.
    active bool
    When false, key is not used for encryption. Defaults to true.
    algorithm string
    Intended algorithm for the key. Defaults to RSA-OAEP
    enabled bool
    When false, key is not accessible in this realm. Defaults to true.
    key_size number
    Size for the generated keys. Defaults to 2048.
    name string
    Display name of provider when linked in admin console.
    priority number
    Priority for the provider. Defaults to 0
    realmId String
    The realm this keystore exists in.
    active Boolean
    When false, key is not used for encryption. Defaults to true.
    algorithm String
    Intended algorithm for the key. Defaults to RSA-OAEP
    enabled Boolean
    When false, key is not accessible in this realm. Defaults to true.
    keySize Integer
    Size for the generated keys. Defaults to 2048.
    name String
    Display name of provider when linked in admin console.
    priority Integer
    Priority for the provider. Defaults to 0
    realmId string
    The realm this keystore exists in.
    active boolean
    When false, key is not used for encryption. Defaults to true.
    algorithm string
    Intended algorithm for the key. Defaults to RSA-OAEP
    enabled boolean
    When false, key is not accessible in this realm. Defaults to true.
    keySize number
    Size for the generated keys. Defaults to 2048.
    name string
    Display name of provider when linked in admin console.
    priority number
    Priority for the provider. Defaults to 0
    realm_id str
    The realm this keystore exists in.
    active bool
    When false, key is not used for encryption. Defaults to true.
    algorithm str
    Intended algorithm for the key. Defaults to RSA-OAEP
    enabled bool
    When false, key is not accessible in this realm. Defaults to true.
    key_size int
    Size for the generated keys. Defaults to 2048.
    name str
    Display name of provider when linked in admin console.
    priority int
    Priority for the provider. Defaults to 0
    realmId String
    The realm this keystore exists in.
    active Boolean
    When false, key is not used for encryption. Defaults to true.
    algorithm String
    Intended algorithm for the key. Defaults to RSA-OAEP
    enabled Boolean
    When false, key is not accessible in this realm. Defaults to true.
    keySize Number
    Size for the generated keys. Defaults to 2048.
    name String
    Display name of provider when linked in admin console.
    priority Number
    Priority for the provider. Defaults to 0

    Outputs

    All input properties are implicitly available as output properties. Additionally, the RealmKeystoreRsaEncGenerated resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing RealmKeystoreRsaEncGenerated Resource

    Get an existing RealmKeystoreRsaEncGenerated resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: RealmKeystoreRsaEncGeneratedState, opts?: CustomResourceOptions): RealmKeystoreRsaEncGenerated
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            active: Optional[bool] = None,
            algorithm: Optional[str] = None,
            enabled: Optional[bool] = None,
            key_size: Optional[int] = None,
            name: Optional[str] = None,
            priority: Optional[int] = None,
            realm_id: Optional[str] = None) -> RealmKeystoreRsaEncGenerated
    func GetRealmKeystoreRsaEncGenerated(ctx *Context, name string, id IDInput, state *RealmKeystoreRsaEncGeneratedState, opts ...ResourceOption) (*RealmKeystoreRsaEncGenerated, error)
    public static RealmKeystoreRsaEncGenerated Get(string name, Input<string> id, RealmKeystoreRsaEncGeneratedState? state, CustomResourceOptions? opts = null)
    public static RealmKeystoreRsaEncGenerated get(String name, Output<String> id, RealmKeystoreRsaEncGeneratedState state, CustomResourceOptions options)
    resources:  _:    type: keycloak:RealmKeystoreRsaEncGenerated    get:      id: ${id}
    import {
      to = keycloak_realm_keystore_rsa_enc_generated.example
      id = "${id}"
    }
    
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Active bool
    When false, key is not used for encryption. Defaults to true.
    Algorithm string
    Intended algorithm for the key. Defaults to RSA-OAEP
    Enabled bool
    When false, key is not accessible in this realm. Defaults to true.
    KeySize int
    Size for the generated keys. Defaults to 2048.
    Name string
    Display name of provider when linked in admin console.
    Priority int
    Priority for the provider. Defaults to 0
    RealmId string
    The realm this keystore exists in.
    Active bool
    When false, key is not used for encryption. Defaults to true.
    Algorithm string
    Intended algorithm for the key. Defaults to RSA-OAEP
    Enabled bool
    When false, key is not accessible in this realm. Defaults to true.
    KeySize int
    Size for the generated keys. Defaults to 2048.
    Name string
    Display name of provider when linked in admin console.
    Priority int
    Priority for the provider. Defaults to 0
    RealmId string
    The realm this keystore exists in.
    active bool
    When false, key is not used for encryption. Defaults to true.
    algorithm string
    Intended algorithm for the key. Defaults to RSA-OAEP
    enabled bool
    When false, key is not accessible in this realm. Defaults to true.
    key_size number
    Size for the generated keys. Defaults to 2048.
    name string
    Display name of provider when linked in admin console.
    priority number
    Priority for the provider. Defaults to 0
    realm_id string
    The realm this keystore exists in.
    active Boolean
    When false, key is not used for encryption. Defaults to true.
    algorithm String
    Intended algorithm for the key. Defaults to RSA-OAEP
    enabled Boolean
    When false, key is not accessible in this realm. Defaults to true.
    keySize Integer
    Size for the generated keys. Defaults to 2048.
    name String
    Display name of provider when linked in admin console.
    priority Integer
    Priority for the provider. Defaults to 0
    realmId String
    The realm this keystore exists in.
    active boolean
    When false, key is not used for encryption. Defaults to true.
    algorithm string
    Intended algorithm for the key. Defaults to RSA-OAEP
    enabled boolean
    When false, key is not accessible in this realm. Defaults to true.
    keySize number
    Size for the generated keys. Defaults to 2048.
    name string
    Display name of provider when linked in admin console.
    priority number
    Priority for the provider. Defaults to 0
    realmId string
    The realm this keystore exists in.
    active bool
    When false, key is not used for encryption. Defaults to true.
    algorithm str
    Intended algorithm for the key. Defaults to RSA-OAEP
    enabled bool
    When false, key is not accessible in this realm. Defaults to true.
    key_size int
    Size for the generated keys. Defaults to 2048.
    name str
    Display name of provider when linked in admin console.
    priority int
    Priority for the provider. Defaults to 0
    realm_id str
    The realm this keystore exists in.
    active Boolean
    When false, key is not used for encryption. Defaults to true.
    algorithm String
    Intended algorithm for the key. Defaults to RSA-OAEP
    enabled Boolean
    When false, key is not accessible in this realm. Defaults to true.
    keySize Number
    Size for the generated keys. Defaults to 2048.
    name String
    Display name of provider when linked in admin console.
    priority Number
    Priority for the provider. Defaults to 0
    realmId String
    The realm this keystore exists in.

    Import

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

    Example:

    $ pulumi import keycloak:index/realmKeystoreRsaEncGenerated:RealmKeystoreRsaEncGenerated keystore_rsa_enc_generated my-realm/618cfba7-49aa-4c09-9a19-2f699b576f0b
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Keycloak pulumi/pulumi-keycloak
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the keycloak Terraform Provider.
    keycloak logo keycloak logo
    Viewing docs for Keycloak v6.14.1
    published on Tuesday, Oct 13, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial