Class JAXBEncryptedKey
java.lang.Object
com.sun.xml.ws.security.opt.impl.enc.JAXBEncryptedKey
- All Implemented Interfaces:
EncryptedKey,SecurityElement,SecurityElementWriter,SecurityHeaderElement,XMLStructure
public class JAXBEncryptedKey
extends Object
implements EncryptedKey, SecurityHeaderElement, SecurityElementWriter
- Author:
- K.Venugopal@sun.com
-
Constructor Summary
ConstructorsConstructorDescriptionJAXBEncryptedKey(EncryptedKeyType ekt, Key kk, Key dk, SOAPVersion soapVersion) Creates a new instance of JAXBEncryptedKey -
Method Summary
Modifier and TypeMethodDescriptionbyte[]canonicalize(String algorithm, List<AttributeNS> namespaceDecls) voiddecrypt()voidencrypt()getAttribute(String nsUri, String localName) getAttribute(QName name) byte[]getId()getKey()Gets the local name of this header element.booleanbooleanbooleanisFeatureSupported(String feature) <T> TreadAsJAXB(jakarta.xml.bind.Unmarshaller unmarshaller) <T> TreadAsJAXB(org.glassfish.jaxb.runtime.api.Bridge<T> bridge) <T> TreadAsJAXB(org.glassfish.jaxb.runtime.api.Bridge<T> bridge, org.glassfish.jaxb.runtime.api.BridgeContext context) Reads the header as aXMLStreamReader.booleanfinds whether the this security header element refers to the element with given idvoidvoidvoidwriteTo(jakarta.xml.soap.SOAPMessage saaj) voidwriteTo(OutputStream os) writes the jaxb encrypted key to to an XMLStreamWritervoidwriteTo(XMLStreamWriter streamWriter) writes the jaxb encrypted key to to an XMLStreamWritervoidwriteTo(XMLStreamWriter streamWriter, HashMap props) writes the jaxb encrypted key to to an XMLStreamWritervoidwriteTo(ContentHandler contentHandler, ErrorHandler errorHandler)
-
Constructor Details
-
JAXBEncryptedKey
public JAXBEncryptedKey(EncryptedKeyType ekt, Key kk, Key dk, SOAPVersion soapVersion) throws XWSSecurityException Creates a new instance of JAXBEncryptedKey- Throws:
XWSSecurityException
-
-
Method Details
-
encrypt
public void encrypt() -
decrypt
public void decrypt() -
getId
- Specified by:
getIdin interfaceSecurityElement- Returns:
- id
-
setId
- Specified by:
setIdin interfaceSecurityElement
-
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceSecurityElement- Returns:
- namespace uri of the security header element.
-
getLocalPart
Description copied from interface:SecurityElementGets the local name of this header element.- Specified by:
getLocalPartin interfaceSecurityElement- Returns:
- this string must be interned.
-
getAttribute
-
getAttribute
-
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- Returns:
- must not null.
-
readAsJAXB
public <T> T readAsJAXB(jakarta.xml.bind.Unmarshaller unmarshaller) -
readAsJAXB
public <T> T readAsJAXB(org.glassfish.jaxb.runtime.api.Bridge<T> bridge, org.glassfish.jaxb.runtime.api.BridgeContext context) -
readAsJAXB
public <T> T readAsJAXB(org.glassfish.jaxb.runtime.api.Bridge<T> bridge) -
writeTo
writes the jaxb encrypted key to to an XMLStreamWriter- Specified by:
writeToin interfaceSecurityElementWriter- Parameters:
streamWriter- javax.xml.stream.XMLStreamWriter- Throws:
XMLStreamException- if the operation fails for some reason. This leaves the writer to an undefined state.
-
writeTo
writes the jaxb encrypted key to to an XMLStreamWriter- Specified by:
writeToin interfaceSecurityElementWriter- Parameters:
os- OutputStream
-
writeTo
public void writeTo(jakarta.xml.soap.SOAPMessage saaj) throws jakarta.xml.soap.SOAPException - Throws:
jakarta.xml.soap.SOAPException
-
writeTo
-
canonicalize
-
isCanonicalized
public boolean isCanonicalized() -
getReferenceList
- Specified by:
getReferenceListin interfaceEncryptedKey
-
hasReferenceList
public boolean hasReferenceList() -
refersToSecHdrWithId
finds whether the this security header element refers to the element with given id- Specified by:
refersToSecHdrWithIdin interfaceSecurityHeaderElement
-
setReferenceList
- Specified by:
setReferenceListin interfaceEncryptedKey
-
getKey
- Specified by:
getKeyin interfaceEncryptedKey
-
getCipherValue
public byte[] getCipherValue() -
writeTo
writes the jaxb encrypted key to to an XMLStreamWriter- Specified by:
writeToin interfaceSecurityElementWriter- Parameters:
streamWriter- javax.xml.stream.XMLStreamWriterprops- HashMap- Throws:
XMLStreamException
-
isFeatureSupported
- Specified by:
isFeatureSupportedin interfaceXMLStructure
-