Arshad Noor
2010-11-22 06:50:29 UTC
Hi,
I'm new to XOM and am experimenting using it to generate and parse
XMLEncryption (XENC) documents (http://www.w3.org/TR/xmlenc-core/).
While the XENC tree is fairly shallow, one particular element - the
CipherValue element - presents some challenges:
1) The first 12 or 24 bytes (depending on the encryption algorithm)
of CipherValue content is only Base64-encoded);
2) The remainder of the CipherValue content, concatenated to the first
12 or 24 bytes from step #1, is encrypted *and* Base64-encoded;
3) 99.99% of the document's content is *inside* this single CipherValue
element.
While DOM/XOM/Stax work fine for reading and writing documents of a
reasonable size (100MB), some documents are expected to be multiple
gigabytes in size. Trying to create a document tree in memory with
such a large file, predictably, crashes the JVM.
Based on sample XOM code, I have extended the NodeFactory and am
trying to process the CipherValue content using startMakingElement()
method. However, not having the position of the underlying stream
in this method (or the Builder/NodeFactory) makes it difficult to
process the CipherValue element's content.
Given my inexperience with XOM, I may be missing a solution obvious
to the experts; are there any suggestions on how I can solve this
problem? Thanks.
Arshad Noor
StrongAuth, Inc.
I'm new to XOM and am experimenting using it to generate and parse
XMLEncryption (XENC) documents (http://www.w3.org/TR/xmlenc-core/).
While the XENC tree is fairly shallow, one particular element - the
CipherValue element - presents some challenges:
1) The first 12 or 24 bytes (depending on the encryption algorithm)
of CipherValue content is only Base64-encoded);
2) The remainder of the CipherValue content, concatenated to the first
12 or 24 bytes from step #1, is encrypted *and* Base64-encoded;
3) 99.99% of the document's content is *inside* this single CipherValue
element.
While DOM/XOM/Stax work fine for reading and writing documents of a
reasonable size (100MB), some documents are expected to be multiple
gigabytes in size. Trying to create a document tree in memory with
such a large file, predictably, crashes the JVM.
Based on sample XOM code, I have extended the NodeFactory and am
trying to process the CipherValue content using startMakingElement()
method. However, not having the position of the underlying stream
in this method (or the Builder/NodeFactory) makes it difficult to
process the CipherValue element's content.
Given my inexperience with XOM, I may be missing a solution obvious
to the experts; are there any suggestions on how I can solve this
problem? Thanks.
Arshad Noor
StrongAuth, Inc.