<model>
    <mount>//OPNsense/IPsec</mount>
    <version>1.0.1</version>
    <description>
        OPNsense IPsec
    </description>
    <items>
        <general>
            <enabled type="LegacyLinkField">
                <Source>ipsec.enable</Source>
            </enabled>
        </general>
        <keyPairs>
            <keyPair type="ArrayField">
                <name type="TextField">
                    <Required>Y</Required>
                </name>
                <keyType type="OptionField">
                    <Required>Y</Required>
                    <default>rsa</default>
                    <OptionValues>
                        <rsa>RSA</rsa>
                        <ecdsa>ECDSA</ecdsa>
                    </OptionValues>
                </keyType>
                <publicKey type="TextField">
                    <Required>Y</Required>
                </publicKey>
                <privateKey type="TextField">
                    <Required>N</Required>
                </privateKey>
                <keySize type="IntegerField"/>
                <keyFingerprint type="TextField"/>
            </keyPair>
        </keyPairs>
        <preSharedKeys>
            <preSharedKey type="ArrayField">
                <ident type="TextField">
                    <Required>Y</Required>
                    <mask>/^([a-zA-Z0-9@\.\-]*)/u</mask>
                    <ValidationMessage>The identifier contains invalid characters.</ValidationMessage>
                    <Constraints>
                        <check001>
                            <ValidationMessage>Another entry with the same identifier already exists.</ValidationMessage>
                            <type>UniqueConstraint</type>
                            <addFields>
                                <field1>remote_ident</field1>
                            </addFields>
                        </check001>
                    </Constraints>
                </ident>
                <remote_ident type="TextField">
                    <Required>N</Required>
                    <mask>/^([a-zA-Z0-9@\.\-]*)/u</mask>
                    <ValidationMessage>The identifier contains invalid characters.</ValidationMessage>
                    <Constraints>
                        <reference>ident.check001</reference>
                    </Constraints>
                </remote_ident>
                <keyType type="OptionField">
                    <Required>Y</Required>
                    <default>PSK</default>
                    <OptionValues>
                        <PSK>PSK</PSK>
                        <EAP>EAP</EAP>
                    </OptionValues>
                </keyType>
                <Key type="TextField">
                    <Required>N</Required>
                </Key>
            </preSharedKey>
        </preSharedKeys>
    </items>
</model>
