I have created a windows app to encrypt connection string. But when I use it in application I get following error

Unrecognized element 'EncryptedData'. (C:\Users\abcde.abcde-PC\Documents\Visual Studio 2008\Projects\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.config line 4)

here is my encrypted connection string

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <connectionStrings configProtectionProvider="RsaProtectedConfigurationProvider">
        <EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element"
            xmlns="http://www.w3.org/2001/04/xmlenc#">
            <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" />
            <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
                <EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#">
                    <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" />
                    <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
                        <KeyName>Rsa Key</KeyName>
                    </KeyInfo>
                    <CipherData>
                        <CipherValue>VYngKPOjxMhs8Fr/5h03WkwMHbHoNsiHQQvndl6lQvDgLcw8JCK/LoTzIQY6QaiekUE1IJMcZs4magXeRJYlUfBO+sfuukpHnzz7UGD+KtZYT7QPI2YB1GnNp+85/FmasylU1iE7I7rZQtvhPfiIV6l9Okih1qIZKfrlyZhZ4r0=</CipherValue>
                    </CipherData>
                </EncryptedKey>
            </KeyInfo>
            <CipherData>
                <CipherValue>A0BQpJ/TKTbGYsW4z9tORMZem7NDe9lZ9KXUor4roks=</CipherValue>
            </CipherData>
        </EncryptedData>
    </connectionStrings>
</configuration>

Related posts

Recent Viewed