|
Oracle Security Developer Tools Web Services Security Java API Reference 11g (11.1.1) E10678-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.security.xmlsec.wss.swa.SWAUtil
public class SWAUtil
Utility classes to deal with encrypting/decrypting/signing/verifying attachments - do not use this directly.
Nested Class Summary | |
---|---|
static class |
SWAUtil.ByteArrayDataSource A byte array exposed as a DataSource - do not use this directly. |
static class |
SWAUtil.SWACIDResolver Implementation of CIDResolver - do not use this directly. |
Field Summary | |
---|---|
static java.lang.String |
AttachmentCiphertextTransform |
static java.lang.String |
AttachmentComplete |
static java.lang.String |
AttachmentCompleteSignatureTransform |
static java.lang.String |
AttachmentContentOnly |
static java.lang.String |
AttachmentContentSignatureTransform |
static java.lang.String |
SWAURI |
Constructor Summary | |
---|---|
SWAUtil() |
Method Summary | |
---|---|
static void |
canonicalizeBodyText(javax.xml.soap.AttachmentPart ap) Canonicalize text bodies by normailizing line endings to CR-LF |
static javax.xml.soap.AttachmentPart |
decryptAttachment(oracle.security.xmlsec.enc.XEEncryptedData ed, javax.crypto.SecretKey key, javax.xml.soap.SOAPMessage msg) Decrypt the attachments. |
static oracle.security.xmlsec.enc.XEEncryptedData |
encryptAttachment(javax.xml.soap.AttachmentPart ap, WSSEncryptionParams encParam, org.w3c.dom.Document doc, java.lang.String contentId, boolean includeHeaders) Encrypt an attachment, and create an EncryptedData element, but does not insert that element anywhere. |
static javax.xml.soap.AttachmentPart |
getAttachment(javax.xml.soap.SOAPMessage msg, java.lang.String uri) Get an attachment from a "cid:" uri |
static java.io.InputStream |
getInputStream(javax.xml.soap.AttachmentPart ap) Get an input stream from AttachmentPart. |
static javax.xml.soap.SOAPMessage |
getSOAPMessage() Return the stored SOAP Message from the thread local storage |
static boolean |
isEncryptedAttacment(oracle.security.xmlsec.enc.XEEncryptedData ed) Check the EncryptedData@Type attribute to see if this is an encryted attachment |
static javax.xml.soap.SOAPMessage |
readFrom(javax.xml.soap.MessageFactory mf, java.io.InputStream in) Wrapper over {@link javax.xml.soap.MessageFactory#createMessage(javax.xml.soap.MimeHeaders, java.io.InputStream) to read the headers as well as the body. |
static void |
setSOAPMessage(javax.xml.soap.SOAPMessage msg) Store the SOAP Message in ThreadLocal storage. |
static void |
writeTo(javax.xml.soap.SOAPMessage msg, java.io.OutputStream out) Wrapper over SOAPMessage.writeTo(OutputStream) to write out the headers as well as the body. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SWAURI
public static final java.lang.String AttachmentContentSignatureTransform
public static final java.lang.String AttachmentCompleteSignatureTransform
public static final java.lang.String AttachmentContentOnly
public static final java.lang.String AttachmentComplete
public static final java.lang.String AttachmentCiphertextTransform
Constructor Detail |
---|
public SWAUtil()
Method Detail |
---|
public static javax.xml.soap.AttachmentPart getAttachment(javax.xml.soap.SOAPMessage msg, java.lang.String uri)
msg
- the SOAP messageuri
- the "cid:" uripublic static void canonicalizeBodyText(javax.xml.soap.AttachmentPart ap)
ap
-public static oracle.security.xmlsec.enc.XEEncryptedData encryptAttachment(javax.xml.soap.AttachmentPart ap, WSSEncryptionParams encParam, org.w3c.dom.Document doc, java.lang.String contentId, boolean includeHeaders) throws oracle.security.xmlsec.enc.XEException
ap
- The attachment to be encryptedencParam
- The encryption parameters
WSSEncryptionParams.getDataEncryptionAlg()
should return the content encryption Algorithm to be used to encrypt the attachmentWSSEncryptionParams.getDataEncryptionKey()
should return the content encryption Key. to be used to encrypt the attachment null content encryption key set, a randomly generated key will be used.WSSEncryptionParams.getIv()
should return the Initialization vector, if null a random IV is generated. Use IV only for test programs where you want the cipher text to be the same in every run.doc
- The XML document, in which all the XML elements are to be createdcontentId
- If the attachment does not already have a Content-Id: header, then this one will be used. (ok to be null, in which case a random content id is generated)includeHeaders
- Whether to include the headersjavax.xml.soap.SOAPException
java.io.IOException
oracle.security.xmlsec.enc.XESchemaException
oracle.security.xmlsec.enc.XECipherException
oracle.security.xmlsec.enc.XEException
public static boolean isEncryptedAttacment(oracle.security.xmlsec.enc.XEEncryptedData ed)
ed
- the EncryptedData objectpublic static javax.xml.soap.AttachmentPart decryptAttachment(oracle.security.xmlsec.enc.XEEncryptedData ed, javax.crypto.SecretKey key, javax.xml.soap.SOAPMessage msg) throws oracle.security.xmlsec.enc.XEException
ed
- the EncryptedData objectkey
- the key to decrypt itmsg
- the SOAPMessageoracle.security.xmlsec.enc.XEException
public static void setSOAPMessage(javax.xml.soap.SOAPMessage msg)
msg
- The message to be storedpublic static javax.xml.soap.SOAPMessage getSOAPMessage()
public static java.io.InputStream getInputStream(javax.xml.soap.AttachmentPart ap) throws java.io.IOException, javax.xml.soap.SOAPException
ap
-java.io.IOException
javax.xml.soap.SOAPException
public static void writeTo(javax.xml.soap.SOAPMessage msg, java.io.OutputStream out) throws java.io.IOException, javax.xml.soap.SOAPException
SOAPMessage.writeTo(OutputStream)
to write out the headers as well as the body.msg
- The SOAPMessage that needs to be written outout
- where it is to be writtenjava.io.IOException
javax.xml.soap.SOAPException
public static javax.xml.soap.SOAPMessage readFrom(javax.xml.soap.MessageFactory mf, java.io.InputStream in) throws java.io.IOException, javax.xml.soap.SOAPException
mf
- MessageFactoryin
- Inputstream consisting of headers as well as bodyjava.io.IOException
javax.xml.soap.SOAPException
|
Oracle Security Developer Tools Web Services Security Java API Reference 11g (11.1.1) E10678-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |