Skip to content

Instantly share code, notes, and snippets.

@darranl
Last active February 16, 2021 13:00
Show Gist options
  • Save darranl/3cca17d43c74ff7b93ae494a0793f432 to your computer and use it in GitHub Desktop.
Save darranl/3cca17d43c74ff7b93ae494a0793f432 to your computer and use it in GitHub Desktop.
# CLI Commands Used For Testing
###################
# STANDALONE MODE #
###################
# Logging may be useful to see the resolution in action.
/subsystem=logging/logger=org.wildfly.extension.elytron:add(level=TRACE)
# Expression Resolver Activation (Default credential-store)
/subsystem=elytron/credential-store=test-store:add(location=test-store.cs, relative-to=jboss.server.config.dir, \
credential-reference={clear-text=password}, create=true)
/subsystem=elytron/expression=encryption:add(resolvers=[{name=A, credential-store=test-store, secret-key=C}], \
default-resolver=A)
# Expression Resolver Activation (secret-key-credential-store)
/subsystem=elytron/secret-key-credential-store=test-store:add(path=test-store.cs, relative-to=jboss.server.config.dir)
/subsystem=elytron/expression=encryption:add(resolvers=[{name=A, credential-store=test-store, secret-key=key}], \
default-resolver=A)
/subsystem=elytron/expression=encryption:create-expression(resolver=A, clear-text="MyPassword")
# Some Resources Using Expressions
/subsystem=elytron/key-store=test:add(relative-to=jboss.server.config.dir, path=test1.keystore, \
type=PKCS12, credential-reference={clear-text="${ENC:AAA}"})
#################################
# DOMAIN MODE - HOST CONTROLLER #
#################################
/host=master/subsystem=elytron/credential-store=test-store:add(location=test-store.cs, \
relative-to=jboss.domain.config.dir, credential-reference={clear-text=password}, create=true)
/host=master/subsystem=elytron/expression=encryption:add(resolvers=[{name=A, credential-store=test-store, \
secret-key=C}], default-resolver=A)
/host=master/subsystem=elytron/key-store=test:add(relative-to=jboss.domain.config.dir, path=test1.keystore, \
type=PKCS12, credential-reference={clear-text="${ENC:AAA}"})
/host=master:reload
# Expression Resolver Activation (secret-key-credential-store)
/host=master/subsystem=elytron/secret-key-credential-store=test-store:add(path=test-store.cs, \
relative-to=jboss.domain.config.dir)
/host=master/subsystem=elytron/expression=encryption:add(resolvers=[{name=A, credential-store=test-store, secret-key=key}], \
default-resolver=A)
/host=master/subsystem=elytron/expression=encryption:create-expression(resolver=A, clear-text="MyPassword")
# Some Resources Using Expressions
/host=master/subsystem=elytron/key-store=test:add(relative-to=jboss.domain.config.dir, path=test1.keystore, \
type=PKCS12, credential-reference={clear-text="${ENC:AAA}"})
#########################
# DOMAIN MODE - PROFILE #
#########################
/profile=default/subsystem=elytron/credential-store=test-store:add(location=test-store.cs, \
relative-to=jboss.domain.config.dir, credential-reference={clear-text=password}, create=true)
/profile=default/subsystem=elytron/expression=encryption:add(resolvers=[{name=A, credential-store=test-store, \
secret-key=C}], default-resolver=A)
/profile=default/subsystem=elytron/key-store=test:add(relative-to=jboss.server.config.dir, path=test1.keystore, \
type=PKCS12, credential-reference={clear-text="${ENC:AAA}"})
# Expression Resolver Activation (secret-key-credential-store)
# This example uses a credential store created and populated by the host controler.
/profile=default/subsystem=elytron/secret-key-credential-store=test-store:add(path=test-store.cs, \
relative-to=jboss.domain.config.dir, create=false, populate=false)
/profile=default/subsystem=elytron/expression=encryption:add(resolvers=[{name=A, credential-store=test-store, \
secret-key=key}], default-resolver=A)
/host=master/subsystem=elytron/expression=encryption:create-expression(resolver=A, clear-text="MyPassword")
# Some Resources Using Expressions
/profile=default/subsystem=elytron/key-store=test:add(relative-to=jboss.domain.config.dir, path=test1.keystore, \
type=PKCS12, credential-reference={clear-text="${ENC:AAA}"})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment