The CRYPT package that allows to create and encrypt a string of characters for the use of Axional Studio passwords and of databases.

1 Firma de documentos

This section shows the functions that allows to sign a document XML. The signature is included to the own document. The functions of the Java security package are used to manage the keys. The following example obtains the XML file that has to be signed and uses the Java security functions to load from the keys warehouse, the entry with which the document must be signed. In the Java section is explained how to create a keys warestore. In the example is obtained the keys warehouse of the file 'c:\Documents and Settings\user\.keystore', the warehouse has a password 'changeit' and the signature is realized with the entry (the warehouse will contain several entries) that has 'mypass' password. Following this section, the functions used will be specified.

Copy
<xsql-script>
    <body>

    <file.chars.write>
        <file type='absolute' name='purchaseorder-signed.xml' />
        <crypt.dsig.sign
            password='changeit'
            keystore='c:\Documents and Settings\user\.keystore'
            keyname='deister-webstudio'
            signature-method='DSA'
        >
        <!-- Load of the keys warehouse located in  'c:\Documents and Settings\user\.keystore' -->
        <!-- the key with 'changeit' password obtains the entry with 'mypass' password.      -->
        <java.security.KeyStore.getEntry name='deister-webstudio' password='mypass'>
            <java.security.KeyStore.load password='changeit' >
                <java.security.KeyStore.getInstance type='JKS'/>
                <file type='absolute' name='c:\Documents and Settings\user\.keystore' />
            </java.security.KeyStore.load>
        </java.security.KeyStore.getEntry>
        <file type='absolute' name='purchaseorder.xml' />
        </crypt.dsig.sign>
    </file.chars.write>

    <println>
        <file.chars.read>
            <file type='absolute' name='purchaseorder-signed.xml' />
        </file.chars.read>
    </println>

    <println>
        Verification of signature is:
        <crypt.dsig.verify>
            <file type='absolute' name='purchaseorder-signed.xml' />
        </crypt.dsig.verify>
    </println>

    </body>
</xsql-script>