Class SignedMessageHeader
java.lang.Object
com.sun.xml.ws.security.opt.impl.dsig.SignedMessagePart
com.sun.xml.ws.security.opt.impl.dsig.SignedMessageHeader
- All Implemented Interfaces:
SecurityElement,SecurityElementWriter,SecurityHeaderElement,SignedData
- Direct Known Subclasses:
EncryptedSignedMessageHeader
public class SignedMessageHeader
extends SignedMessagePart
implements SecurityHeaderElement, SignedData, SecurityElementWriter
A wrapper over a
Header or a SecurityHeaderElement- Author:
- K.Venugopal@sun.com
-
Field Summary
Fields inherited from class com.sun.xml.ws.security.opt.impl.dsig.SignedMessagePart
isCanonicalized -
Constructor Summary
ConstructorsConstructorDescriptionSignedMessageHeader(com.sun.xml.ws.api.message.Header header, String id, JAXBFilterProcessingContext context) Creates a new instance of SignedMessageHeaderSign aSecurityHeaderElement -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getId()Gets the local name of this header element.com.sun.xml.ws.api.message.HeaderReads the header as aXMLStreamReader.booleanvoidsetDigestValue(byte[] digestValue) voidAssign an id to the SignedMessageHeadervoidwriteTo(OutputStream os) Write the header to the passed outputStreamvoidwriteTo(XMLStreamWriter streamWriter) Write the header to an XMLStreamWritervoidwriteTo(XMLStreamWriter streamWriter, HashMap props) Write the header to an XMLStreamWriterMethods inherited from class com.sun.xml.ws.security.opt.impl.dsig.SignedMessagePart
getAttributeValuePrefixes, writeCanonicalized
-
Constructor Details
-
SignedMessageHeader
public SignedMessageHeader(com.sun.xml.ws.api.message.Header header, String id, JAXBFilterProcessingContext context) Creates a new instance of SignedMessageHeader- Parameters:
header- The SOAP Header which is to be signedid- The id assigned to the SOAP headercontext- JAXBFilterProcessingContext
-
SignedMessageHeader
Sign aSecurityHeaderElement- Parameters:
she- The SecurityHeaderElement to be signed
-
-
Method Details
-
getId
- Specified by:
getIdin interfaceSecurityElement- Overrides:
getIdin classSignedMessagePart- Returns:
- the id of the SignedMessageHeader
-
setId
Assign an id to the SignedMessageHeader- Specified by:
setIdin interfaceSecurityElement- Overrides:
setIdin classSignedMessagePart
-
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceSecurityElement- Overrides:
getNamespaceURIin classSignedMessagePart- Returns:
- the namespace of the underlying SOAP header or SecurityHeaderElement
-
getLocalPart
Description copied from interface:SecurityElementGets the local name of this header element.- Specified by:
getLocalPartin interfaceSecurityElement- Overrides:
getLocalPartin classSignedMessagePart- Returns:
- The localname of the underlying SOAP Header or SecurityHeaderElement
-
readHeader
Description copied from interface:SecurityElementReads the header as aXMLStreamReader.The returned parser points at the start element of this header. (IOW,
XMLStreamReader.getEventType()would returnXMLStreamConstants.START_ELEMENT.Performance Expectation
For some Header implementations, this operation is a non-trivial operation. Therefore, use of this method is discouraged unless the caller is interested in reading the whole header.
Similarly, if the caller wants to use this method only to do the API conversion (such as simply firing SAX events from
XMLStreamReader), then the JAX-WS team requests that you talk to us.Messages that come from tranport usually provides a reasonably efficient implementation of this method.
- Specified by:
readHeaderin interfaceSecurityElement- Overrides:
readHeaderin classSignedMessagePart- Returns:
- The header as as XMLStreamReader
- Throws:
XMLStreamException
-
writeTo
Write the header to the passed outputStream- Specified by:
writeToin interfaceSecurityElementWriter- Overrides:
writeToin classSignedMessagePart
-
writeTo
Write the header to an XMLStreamWriter- Specified by:
writeToin interfaceSecurityElementWriter- Overrides:
writeToin classSignedMessagePart- Throws:
XMLStreamException- if the operation fails for some reason. This leaves the writer to an undefined state.
-
writeTo
Write the header to an XMLStreamWriter- Specified by:
writeToin interfaceSecurityElementWriter- Overrides:
writeToin classSignedMessagePart- Throws:
XMLStreamException
-
setDigestValue
public void setDigestValue(byte[] digestValue) - Specified by:
setDigestValuein interfaceSignedData- Overrides:
setDigestValuein classSignedMessagePart
-
getDigestValue
public byte[] getDigestValue()- Specified by:
getDigestValuein interfaceSignedData- Overrides:
getDigestValuein classSignedMessagePart- Returns:
- The DigestValue of this Header
-
refersToSecHdrWithId
- Specified by:
refersToSecHdrWithIdin interfaceSecurityHeaderElement- Parameters:
id- The id of the SecurityHeaderElement against which to compare- Returns:
- true if the current SecurityHeaderElement has reference to the SecurityHeaderElement with passed id
-
getSignedHeader
public com.sun.xml.ws.api.message.Header getSignedHeader()
-