Package org.apache.wss4j.stax.utils
Class WSSUtils
- java.lang.Object
-
- org.apache.xml.security.stax.ext.XMLSecurityUtils
-
- org.apache.wss4j.stax.utils.WSSUtils
-
public class WSSUtils extends org.apache.xml.security.stax.ext.XMLSecurityUtils
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedWSSUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcreateBinarySecurityTokenStructure(org.apache.xml.security.stax.ext.AbstractOutputProcessor abstractOutputProcessor, org.apache.xml.security.stax.ext.OutputProcessorChain outputProcessorChain, String referenceId, X509Certificate[] x509Certificates, boolean useSingleCertificate)static voidcreateBSTReferenceStructure(org.apache.xml.security.stax.ext.AbstractOutputProcessor abstractOutputProcessor, org.apache.xml.security.stax.ext.OutputProcessorChain outputProcessorChain, String referenceId, String valueType, boolean includedInMessage)static voidcreateEmbeddedKeyIdentifierStructure(org.apache.xml.security.stax.ext.AbstractOutputProcessor abstractOutputProcessor, org.apache.xml.security.stax.ext.OutputProcessorChain outputProcessorChain, org.apache.xml.security.stax.securityToken.SecurityTokenConstants.TokenType tokenType, String referenceId)static voidcreateEncryptedDataStructureForAttachments(org.apache.xml.security.stax.ext.AbstractOutputProcessor abstractOutputProcessor, org.apache.xml.security.stax.ext.OutputProcessorChain outputProcessorChain)static voidcreateEncryptedKeySha1IdentifierStructure(org.apache.xml.security.stax.ext.AbstractOutputProcessor abstractOutputProcessor, org.apache.xml.security.stax.ext.OutputProcessorChain outputProcessorChain, String identifier)static voidcreateEncryptedKeySha1IdentifierStructure(org.apache.xml.security.stax.ext.AbstractOutputProcessor abstractOutputProcessor, org.apache.xml.security.stax.ext.OutputProcessorChain outputProcessorChain, Key key)static voidcreateKerberosSha1IdentifierStructure(org.apache.xml.security.stax.ext.AbstractOutputProcessor abstractOutputProcessor, org.apache.xml.security.stax.ext.OutputProcessorChain outputProcessorChain, String identifier)static voidcreateReferenceListStructureForEncryption(org.apache.xml.security.stax.ext.AbstractOutputProcessor abstractOutputProcessor, org.apache.xml.security.stax.ext.OutputProcessorChain outputProcessorChain)static voidcreateSAMLKeyIdentifierStructure(org.apache.xml.security.stax.ext.AbstractOutputProcessor abstractOutputProcessor, org.apache.xml.security.stax.ext.OutputProcessorChain outputProcessorChain, org.apache.xml.security.stax.securityToken.SecurityTokenConstants.TokenType tokenType, String referenceId)static voidcreateThumbprintKeyIdentifierStructure(org.apache.xml.security.stax.ext.AbstractOutputProcessor abstractOutputProcessor, org.apache.xml.security.stax.ext.OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates)static org.apache.xml.security.stax.securityEvent.TokenSecurityEvent<? extends org.apache.xml.security.stax.securityToken.InboundSecurityToken>createTokenSecurityEvent(org.apache.xml.security.stax.securityToken.InboundSecurityToken inboundSecurityToken, String correlationID)static voidcreateUsernameTokenReferenceStructure(org.apache.xml.security.stax.ext.AbstractOutputProcessor abstractOutputProcessor, org.apache.xml.security.stax.ext.OutputProcessorChain outputProcessorChain, String tokenId)static voidcreateX509KeyIdentifierStructure(org.apache.xml.security.stax.ext.AbstractOutputProcessor abstractOutputProcessor, org.apache.xml.security.stax.ext.OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates)static voidcreateX509SubjectKeyIdentifierStructure(org.apache.xml.security.stax.ext.AbstractOutputProcessor abstractOutputProcessor, org.apache.xml.security.stax.ext.OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates)static voiddoPasswordCallback(CallbackHandler callbackHandler, Callback callback)Executes the Callback handling.static voiddoSecretKeyCallback(CallbackHandler callbackHandler, Callback callback)Try to get the secret key from a CallbackHandler implementationstatic <T extends org.apache.xml.security.stax.securityToken.SecurityToken>
TgetRootToken(T securityToken)static StringgetSOAPMessageVersionNamespace(org.apache.xml.security.stax.ext.stax.XMLSecEvent xmlSecEvent)static booleanisInSecurityHeader(org.apache.xml.security.stax.ext.stax.XMLSecEvent xmlSecEvent, String actorOrRole)static booleanisInSecurityHeader(org.apache.xml.security.stax.ext.stax.XMLSecEvent xmlSecEvent, List<QName> elementPath, String actorOrRole)static booleanisInSOAPBody(List<QName> elementPath)static booleanisInSOAPBody(org.apache.xml.security.stax.ext.stax.XMLSecEvent xmlSecEvent)static booleanisInSOAPHeader(List<QName> elementPath)static booleanisInSOAPHeader(org.apache.xml.security.stax.ext.stax.XMLSecEvent xmlSecEvent)static booleanisResponsibleActorOrRole(org.apache.xml.security.stax.ext.stax.XMLSecStartElement xmlSecStartElement, String responsibleActor)static booleanisSecurityHeaderElement(org.apache.xml.security.stax.ext.stax.XMLSecEvent xmlSecEvent, String actorOrRole)static StringpathAsString(List<QName> path)static booleanpathMatches(List<QName> path1, List<QName> path2)static booleanpathMatches(List<QName> path1, List<QName> path2, boolean lastElementWildCard)-
Methods inherited from class org.apache.xml.security.stax.ext.XMLSecurityUtils
copy, createKeyNameTokenStructure, createKeyValueTokenStructure, createKeyValueTokenStructure, createX509CertificateStructure, createX509CertificateStructure, createX509IssuerSerialStructure, createX509IssuerSerialStructure, createX509SubjectKeyIdentifierStructure, createX509SubjectNameStructure, createX509SubjectNameStructure, dropReferenceMarker, getExcC14NInclusiveNamespacePrefixes, getQNameAttribute, getQNameType, getTransformer, getXMLEventAsString, loadXMLSecuritySchemas, prepareSecretKey
-
-
-
-
Method Detail
-
doPasswordCallback
public static void doPasswordCallback(CallbackHandler callbackHandler, Callback callback) throws WSSecurityException
Executes the Callback handling. Typically used to fetch passwords- Parameters:
callbackHandler-callback-- Throws:
WSSecurityException- if the callback couldn't be executed
-
doSecretKeyCallback
public static void doSecretKeyCallback(CallbackHandler callbackHandler, Callback callback) throws WSSecurityException
Try to get the secret key from a CallbackHandler implementation- Parameters:
callbackHandler- a CallbackHandler implementation- Throws:
WSSecurityException
-
getSOAPMessageVersionNamespace
public static String getSOAPMessageVersionNamespace(org.apache.xml.security.stax.ext.stax.XMLSecEvent xmlSecEvent)
-
isInSOAPHeader
public static boolean isInSOAPHeader(org.apache.xml.security.stax.ext.stax.XMLSecEvent xmlSecEvent)
-
isInSOAPBody
public static boolean isInSOAPBody(org.apache.xml.security.stax.ext.stax.XMLSecEvent xmlSecEvent)
-
isInSecurityHeader
public static boolean isInSecurityHeader(org.apache.xml.security.stax.ext.stax.XMLSecEvent xmlSecEvent, String actorOrRole)
-
isInSecurityHeader
public static boolean isInSecurityHeader(org.apache.xml.security.stax.ext.stax.XMLSecEvent xmlSecEvent, List<QName> elementPath, String actorOrRole)
-
isSecurityHeaderElement
public static boolean isSecurityHeaderElement(org.apache.xml.security.stax.ext.stax.XMLSecEvent xmlSecEvent, String actorOrRole)
-
isResponsibleActorOrRole
public static boolean isResponsibleActorOrRole(org.apache.xml.security.stax.ext.stax.XMLSecStartElement xmlSecStartElement, String responsibleActor)
-
createBinarySecurityTokenStructure
public static void createBinarySecurityTokenStructure(org.apache.xml.security.stax.ext.AbstractOutputProcessor abstractOutputProcessor, org.apache.xml.security.stax.ext.OutputProcessorChain outputProcessorChain, String referenceId, X509Certificate[] x509Certificates, boolean useSingleCertificate) throws XMLStreamException, org.apache.xml.security.exceptions.XMLSecurityException- Throws:
XMLStreamExceptionorg.apache.xml.security.exceptions.XMLSecurityException
-
createX509SubjectKeyIdentifierStructure
public static void createX509SubjectKeyIdentifierStructure(org.apache.xml.security.stax.ext.AbstractOutputProcessor abstractOutputProcessor, org.apache.xml.security.stax.ext.OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates) throws org.apache.xml.security.exceptions.XMLSecurityException, XMLStreamException- Throws:
org.apache.xml.security.exceptions.XMLSecurityExceptionXMLStreamException
-
createX509KeyIdentifierStructure
public static void createX509KeyIdentifierStructure(org.apache.xml.security.stax.ext.AbstractOutputProcessor abstractOutputProcessor, org.apache.xml.security.stax.ext.OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates) throws XMLStreamException, org.apache.xml.security.exceptions.XMLSecurityException- Throws:
XMLStreamExceptionorg.apache.xml.security.exceptions.XMLSecurityException
-
createThumbprintKeyIdentifierStructure
public static void createThumbprintKeyIdentifierStructure(org.apache.xml.security.stax.ext.AbstractOutputProcessor abstractOutputProcessor, org.apache.xml.security.stax.ext.OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates) throws XMLStreamException, org.apache.xml.security.exceptions.XMLSecurityException- Throws:
XMLStreamExceptionorg.apache.xml.security.exceptions.XMLSecurityException
-
createEncryptedKeySha1IdentifierStructure
public static void createEncryptedKeySha1IdentifierStructure(org.apache.xml.security.stax.ext.AbstractOutputProcessor abstractOutputProcessor, org.apache.xml.security.stax.ext.OutputProcessorChain outputProcessorChain, Key key) throws XMLStreamException, org.apache.xml.security.exceptions.XMLSecurityException- Throws:
XMLStreamExceptionorg.apache.xml.security.exceptions.XMLSecurityException
-
createEncryptedKeySha1IdentifierStructure
public static void createEncryptedKeySha1IdentifierStructure(org.apache.xml.security.stax.ext.AbstractOutputProcessor abstractOutputProcessor, org.apache.xml.security.stax.ext.OutputProcessorChain outputProcessorChain, String identifier) throws XMLStreamException, org.apache.xml.security.exceptions.XMLSecurityException- Throws:
XMLStreamExceptionorg.apache.xml.security.exceptions.XMLSecurityException
-
createKerberosSha1IdentifierStructure
public static void createKerberosSha1IdentifierStructure(org.apache.xml.security.stax.ext.AbstractOutputProcessor abstractOutputProcessor, org.apache.xml.security.stax.ext.OutputProcessorChain outputProcessorChain, String identifier) throws XMLStreamException, org.apache.xml.security.exceptions.XMLSecurityException- Throws:
XMLStreamExceptionorg.apache.xml.security.exceptions.XMLSecurityException
-
createBSTReferenceStructure
public static void createBSTReferenceStructure(org.apache.xml.security.stax.ext.AbstractOutputProcessor abstractOutputProcessor, org.apache.xml.security.stax.ext.OutputProcessorChain outputProcessorChain, String referenceId, String valueType, boolean includedInMessage) throws XMLStreamException, org.apache.xml.security.exceptions.XMLSecurityException- Throws:
XMLStreamExceptionorg.apache.xml.security.exceptions.XMLSecurityException
-
createEmbeddedKeyIdentifierStructure
public static void createEmbeddedKeyIdentifierStructure(org.apache.xml.security.stax.ext.AbstractOutputProcessor abstractOutputProcessor, org.apache.xml.security.stax.ext.OutputProcessorChain outputProcessorChain, org.apache.xml.security.stax.securityToken.SecurityTokenConstants.TokenType tokenType, String referenceId) throws XMLStreamException, org.apache.xml.security.exceptions.XMLSecurityException- Throws:
XMLStreamExceptionorg.apache.xml.security.exceptions.XMLSecurityException
-
createSAMLKeyIdentifierStructure
public static void createSAMLKeyIdentifierStructure(org.apache.xml.security.stax.ext.AbstractOutputProcessor abstractOutputProcessor, org.apache.xml.security.stax.ext.OutputProcessorChain outputProcessorChain, org.apache.xml.security.stax.securityToken.SecurityTokenConstants.TokenType tokenType, String referenceId) throws XMLStreamException, org.apache.xml.security.exceptions.XMLSecurityException- Throws:
XMLStreamExceptionorg.apache.xml.security.exceptions.XMLSecurityException
-
createUsernameTokenReferenceStructure
public static void createUsernameTokenReferenceStructure(org.apache.xml.security.stax.ext.AbstractOutputProcessor abstractOutputProcessor, org.apache.xml.security.stax.ext.OutputProcessorChain outputProcessorChain, String tokenId) throws XMLStreamException, org.apache.xml.security.exceptions.XMLSecurityException- Throws:
XMLStreamExceptionorg.apache.xml.security.exceptions.XMLSecurityException
-
createReferenceListStructureForEncryption
public static void createReferenceListStructureForEncryption(org.apache.xml.security.stax.ext.AbstractOutputProcessor abstractOutputProcessor, org.apache.xml.security.stax.ext.OutputProcessorChain outputProcessorChain) throws XMLStreamException, org.apache.xml.security.exceptions.XMLSecurityException- Throws:
XMLStreamExceptionorg.apache.xml.security.exceptions.XMLSecurityException
-
createEncryptedDataStructureForAttachments
public static void createEncryptedDataStructureForAttachments(org.apache.xml.security.stax.ext.AbstractOutputProcessor abstractOutputProcessor, org.apache.xml.security.stax.ext.OutputProcessorChain outputProcessorChain) throws XMLStreamException, org.apache.xml.security.exceptions.XMLSecurityException- Throws:
XMLStreamExceptionorg.apache.xml.security.exceptions.XMLSecurityException
-
createTokenSecurityEvent
public static org.apache.xml.security.stax.securityEvent.TokenSecurityEvent<? extends org.apache.xml.security.stax.securityToken.InboundSecurityToken> createTokenSecurityEvent(org.apache.xml.security.stax.securityToken.InboundSecurityToken inboundSecurityToken, String correlationID) throws WSSecurityException- Throws:
WSSecurityException
-
pathMatches
public static boolean pathMatches(List<QName> path1, List<QName> path2, boolean lastElementWildCard)
-
getRootToken
public static <T extends org.apache.xml.security.stax.securityToken.SecurityToken> T getRootToken(T securityToken) throws org.apache.xml.security.exceptions.XMLSecurityException- Throws:
org.apache.xml.security.exceptions.XMLSecurityException
-
-