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 aHeaderor aSecurityHeaderElement- Author:
- K.Venugopal@sun.com
-
-
Field Summary
-
Fields inherited from class com.sun.xml.ws.security.opt.impl.dsig.SignedMessagePart
isCanonicalized
-
-
Constructor Summary
Constructors Constructor Description SignedMessageHeader(Header header, String id, JAXBFilterProcessingContext context)Creates a new instance of SignedMessageHeaderSignedMessageHeader(SecurityHeaderElement she)Sign aSecurityHeaderElement
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getDigestValue()StringgetId()StringgetLocalPart()Gets the local name of this header element.StringgetNamespaceURI()HeadergetSignedHeader()XMLStreamReaderreadHeader()Reads the header as aXMLStreamReader.booleanrefersToSecHdrWithId(String id)voidsetDigestValue(byte[] digestValue)voidsetId(String id)Assign 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 XMLStreamWriter-
Methods inherited from class com.sun.xml.ws.security.opt.impl.dsig.SignedMessagePart
getAttributeValuePrefixes, writeCanonicalized
-
-
-
-
Constructor Detail
-
SignedMessageHeader
public SignedMessageHeader(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
public SignedMessageHeader(SecurityHeaderElement she)
Sign aSecurityHeaderElement- Parameters:
she- The SecurityHeaderElement to be signed
-
-
Method Detail
-
getId
public String getId()
- Specified by:
getIdin interfaceSecurityElement- Overrides:
getIdin classSignedMessagePart- Returns:
- the id of the SignedMessageHeader
-
setId
public void setId(String id)
Assign an id to the SignedMessageHeader- Specified by:
setIdin interfaceSecurityElement- Overrides:
setIdin classSignedMessagePart
-
getNamespaceURI
@NotNull public String getNamespaceURI()
- Specified by:
getNamespaceURIin interfaceSecurityElement- Overrides:
getNamespaceURIin classSignedMessagePart- Returns:
- the namespace of the underlying SOAP header or SecurityHeaderElement
-
getLocalPart
@NotNull public String 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
public XMLStreamReader readHeader() throws XMLStreamException
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
public void writeTo(OutputStream os)
Write the header to the passed outputStream- Specified by:
writeToin interfaceSecurityElementWriter- Overrides:
writeToin classSignedMessagePart
-
writeTo
public void writeTo(XMLStreamWriter streamWriter) throws XMLStreamException
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
public void writeTo(XMLStreamWriter streamWriter, HashMap props) throws XMLStreamException
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
public boolean refersToSecHdrWithId(String id)
- 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 Header getSignedHeader()
-
-