encryption example

View: New views
5 Messages — Rating Filter:   Alert me  

encryption example

by Björn-Peter Tietjens-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

i would appriciate some help with on eof the examples:

i am trying to run the
"xml-security-1_4_3/src_samples/org/apache/xml/security/samples/encryption"
Example.

I get an Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/xml/utils/URI$MalformedURIException
    at ...Encrypter.main(Encrypter.java:149)

these are the lines...
...
147    String algorithmURI = XMLCipher.TRIPLEDES_KeyWrap;
148
149    XMLCipher keyCipher = XMLCipher.getInstance(algorithmURI);
...

what am i doing wrong?
thanx for some hint on that.
Cheers
Björn

The whole error message:
Key encryption key stored in
file:/home/btietjens/Projekte/workspace/Communicator/kek
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/xml/utils/URI$MalformedURIException
    at de.rbag.util.encryption.Encrypter.main(Encrypter.java:149)
Caused by: java.lang.ClassNotFoundException:
org.apache.xml.utils.URI$MalformedURIException
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    ... 1 more

--



Re: encryption example

by sean.mullan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That class is included in Xalan. Looks like you are not including xalan.jar in
your CLASSPATH.

--Sean


Björn-Peter Tietjens wrote:

> Hi,
>
> i would appriciate some help with on eof the examples:
>
> i am trying to run the
> "xml-security-1_4_3/src_samples/org/apache/xml/security/samples/encryption"
> Example.
>
> I get an Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/xml/utils/URI$MalformedURIException
>    at ...Encrypter.main(Encrypter.java:149)
>
> these are the lines...
> ...
> 147    String algorithmURI = XMLCipher.TRIPLEDES_KeyWrap;
> 148
> 149    XMLCipher keyCipher = XMLCipher.getInstance(algorithmURI);
> ...
>
> what am i doing wrong?
> thanx for some hint on that.
> Cheers
> Björn
>
> The whole error message:
> Key encryption key stored in
> file:/home/btietjens/Projekte/workspace/Communicator/kek
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/xml/utils/URI$MalformedURIException
>    at de.rbag.util.encryption.Encrypter.main(Encrypter.java:149)
> Caused by: java.lang.ClassNotFoundException:
> org.apache.xml.utils.URI$MalformedURIException
>    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>    at java.security.AccessController.doPrivileged(Native Method)
>    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
>    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
>    ... 1 more
>


Re: encryption example

by Björn-Peter Tietjens-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

yes, thank you for your help!
now it works. :-)

Sean Mullan schrieb:

> That class is included in Xalan. Looks like you are not including
> xalan.jar in your CLASSPATH.
>
> --Sean
>
>
> Björn-Peter Tietjens wrote:
>> Hi,
>>
>> i would appriciate some help with on eof the examples:
>>
>> i am trying to run the
>> "xml-security-1_4_3/src_samples/org/apache/xml/security/samples/encryption"
>> Example.
>>
>> I get an Exception in thread "main" java.lang.NoClassDefFoundError:
>> org/apache/xml/utils/URI$MalformedURIException
>>    at ...Encrypter.main(Encrypter.java:149)
>>
>> these are the lines...
>> ...
>> 147    String algorithmURI = XMLCipher.TRIPLEDES_KeyWrap;
>> 148
>> 149    XMLCipher keyCipher = XMLCipher.getInstance(algorithmURI);
>> ...
>>
>> what am i doing wrong?
>> thanx for some hint on that.
>> Cheers
>> Björn
>>
>> The whole error message:
>> Key encryption key stored in
>> file:/home/btietjens/Projekte/workspace/Communicator/kek
>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> org/apache/xml/utils/URI$MalformedURIException
>>    at de.rbag.util.encryption.Encrypter.main(Encrypter.java:149)
>> Caused by: java.lang.ClassNotFoundException:
>> org.apache.xml.utils.URI$MalformedURIException
>>    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>>    at java.security.AccessController.doPrivileged(Native Method)
>>    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>>    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>>    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
>>    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>>    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
>>    ... 1 more
>>
>
>

--
++ Business-Software aus einer Hand ++
++ Internet, Warenwirtschaft, Linux, Virtualisierung ++
http://www.intersales.de

interSales AG Internet Commerce
Subbelrather Str. 247
50825 Köln

Tel  02 21 - 27 90 50
Fax  02 21 - 27 90 517
Mail bt@...
Web  www.intersales.de

Handelsregister Köln HR B 30904
Finanzamt Köln-Nord. UstID: DE199672015
Aufsichtsratsvorsitzender: Michael Morgenstern
Vorstand: Andrej Radonic (Vorsitzender), Peter Zander


encryption example

by Björn-Peter Tietjens-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

i keep getting the exception:

13:34:52,400 ERROR Encrypter:178 -
org.apache.xml.security.encryption.XMLEncryptionException: Invalid key
length: 16 bytes(Invalid key length: 16 bytes)


i used the encryption sample to encrypt some xml doc when executing this
on the tomcat webapp it keeps telling me that the key has an invalid
length... but it generated the key itself as in the example.

Thanx for some hint.
Cheers Björn

Re: encryption example

by Björn-Peter Tietjens-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

sry got confused with the key...
now it works...

Cheers
BT




Björn-Peter Tietjens schrieb:

> Hi,
>
> i keep getting the exception:
>
> 13:34:52,400 ERROR Encrypter:178 -
> org.apache.xml.security.encryption.XMLEncryptionException: Invalid key
> length: 16 bytes(Invalid key length: 16 bytes)
>
>
> i used the encryption sample to encrypt some xml doc when executing
> this on the tomcat webapp it keeps telling me that the key has an
> invalid length... but it generated the key itself as in the example.
>
> Thanx for some hint.
> Cheers Björn
>

--
++ Business-Software aus einer Hand ++
++ Internet, Warenwirtschaft, Linux, Virtualisierung ++
http://www.intersales.de

interSales AG Internet Commerce
Subbelrather Str. 247
50825 Köln

Tel  02 21 - 27 90 50
Fax  02 21 - 27 90 517
Mail bt@...
Web  www.intersales.de

Handelsregister Köln HR B 30904
Finanzamt Köln-Nord. UstID: DE199672015
Aufsichtsratsvorsitzender: Michael Morgenstern
Vorstand: Andrej Radonic (Vorsitzender), Peter Zander