[[Security_Property_Migration]]
= Security Properties

ifdef::env-github[]
:tip-caption: :bulb:
:note-caption: :information_source:
:important-caption: :heavy_exclamation_mark:
:caution-caption: :fire:
:warning-caption: :warning:
endif::[]

Lets suppose security properties "a" and "c" defined in legacy security:

[source,xml,options="nowrap"]
----
        <subsystem xmlns="urn:jboss:domain:security:2.0">
            ...
            <security-properties>
                <property name="a" value="b" />
                <property name="c" value="d" />
            </security-properties>
        </subsystem>
----

To define security properties in Elytron subsystem you need to set
attribute `security-properties` of the subsystem:

[source,options="nowrap"]
----
./subsystem=elytron:write-attribute(name=security-properties, value={ \
    a = "b", \
    c = "d" \
})
----

You can also add or change one another property without modification of
others using map operations. Following command will set property "e":

[source,options="nowrap"]
----
./subsystem=elytron:map-put(name=security-properties, key=e, value=f)
----

By the same way you can also remove one of properties - in example newly
created property "e":

[source,options="nowrap"]
----
./subsystem=elytron:map-remove(name=security-properties, key=e)
----

Output XML configuration will be:

[source,xml,options="nowrap"]
----
        <subsystem xmlns="urn:wildfly:elytron:1.0" final-providers="combined-providers" disallowed-providers="OracleUcrypto">
            <security-properties>
                <security-property name="a" value="b"/>
                <security-property name="c" value="d"/>
            </security-properties>
            ...
        </subsystem>
----
