Package org.apache.wss4j.dom.str
Class STRParserUtil
java.lang.Object
org.apache.wss4j.dom.str.STRParserUtil
Some utilities for the STRParsers.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckBinarySecurityBSPCompliance(SecurityTokenReference secRef, BinarySecurity token, BSPEnforcer bspEnforcer) Check that the BinarySecurityToken referenced by the SecurityTokenReference argument is BSP compliant.static voidcheckEncryptedKeyBSPCompliance(SecurityTokenReference secRef, BSPEnforcer bspEnforcer) Check that the EncryptedKey referenced by the SecurityTokenReference argument is BSP compliant.static voidcheckSamlTokenBSPCompliance(SecurityTokenReference secRef, SamlAssertionWrapper samlAssertion, BSPEnforcer bspEnforcer) Check that the SAML token referenced by the SecurityTokenReference argument is BSP compliant.static voidcheckUsernameTokenBSPCompliance(SecurityTokenReference secRef, BSPEnforcer bspEnforcer) Check that the Username token referenced by the SecurityTokenReference argument is BSP compliant.static ElementfindProcessedTokenElement(Document doc, WSDocInfo docInfo, CallbackHandler cb, String uri, String type) Find a token that has been processed already - in other words, it access previous results to find the element, rather than conducting a general searchstatic ElementfindUnprocessedTokenElement(Document doc, WSDocInfo docInfo, String uri, String type) Find a token that has not been processed already - in other words, it searches for the element, rather than trying to access previous results to find the elementstatic SamlAssertionWrappergetAssertionFromKeyIdentifier(SecurityTokenReference secRef, Element strElement, RequestData request) Get an SamlAssertionWrapper object from parsing a SecurityTokenReference that uses a KeyIdentifier that points to a SAML Assertion.static byte[]getSecretKeyFromToken(String id, String type, int identifier, RequestData data) Get the Secret Key from a CallbackHandlerstatic ElementgetTokenElement(Document doc, WSDocInfo docInfo, CallbackHandler cb, String uri, String valueType)
-
Method Details
-
getAssertionFromKeyIdentifier
public static SamlAssertionWrapper getAssertionFromKeyIdentifier(SecurityTokenReference secRef, Element strElement, RequestData request) throws WSSecurityException Get an SamlAssertionWrapper object from parsing a SecurityTokenReference that uses a KeyIdentifier that points to a SAML Assertion.- Parameters:
secRef- the SecurityTokenReference to the SAML AssertionstrElement- The SecurityTokenReference DOM elementrequest- The RequestData instance used to obtain configuration- Returns:
- an SamlAssertionWrapper object
- Throws:
WSSecurityException
-
checkBinarySecurityBSPCompliance
public static void checkBinarySecurityBSPCompliance(SecurityTokenReference secRef, BinarySecurity token, BSPEnforcer bspEnforcer) throws WSSecurityException Check that the BinarySecurityToken referenced by the SecurityTokenReference argument is BSP compliant.- Parameters:
secRef- The SecurityTokenReference to the BinarySecurityTokentoken- The BinarySecurityTokenbspEnforcer- a BSPEnforcer instance to enforce BSP rules- Throws:
WSSecurityException
-
checkEncryptedKeyBSPCompliance
public static void checkEncryptedKeyBSPCompliance(SecurityTokenReference secRef, BSPEnforcer bspEnforcer) throws WSSecurityException Check that the EncryptedKey referenced by the SecurityTokenReference argument is BSP compliant.- Parameters:
secRef- The SecurityTokenReference to the BinarySecurityTokenbspEnforcer- a BSPEnforcer instance to enforce BSP rules- Throws:
WSSecurityException
-
checkSamlTokenBSPCompliance
public static void checkSamlTokenBSPCompliance(SecurityTokenReference secRef, SamlAssertionWrapper samlAssertion, BSPEnforcer bspEnforcer) throws WSSecurityException Check that the SAML token referenced by the SecurityTokenReference argument is BSP compliant.- Parameters:
secRef- The SecurityTokenReference to the SAML tokensamlAssertion- The SAML Token SamlAssertionWrapper objectbspEnforcer- a BSPEnforcer instance to enforce BSP rules- Throws:
WSSecurityException
-
checkUsernameTokenBSPCompliance
public static void checkUsernameTokenBSPCompliance(SecurityTokenReference secRef, BSPEnforcer bspEnforcer) throws WSSecurityException Check that the Username token referenced by the SecurityTokenReference argument is BSP compliant.- Parameters:
secRef- The SecurityTokenReference to the Username tokenbspEnforcer- a BSPEnforcer instance to enforce BSP rules- Throws:
WSSecurityException
-
getSecretKeyFromToken
public static byte[] getSecretKeyFromToken(String id, String type, int identifier, RequestData data) throws WSSecurityException Get the Secret Key from a CallbackHandler- Parameters:
id- The id of the elementtype- The type of the element (may be null)identifier- The WSPasswordCallback usage identifier- Returns:
- A Secret Key
- Throws:
WSSecurityException
-
getTokenElement
public static Element getTokenElement(Document doc, WSDocInfo docInfo, CallbackHandler cb, String uri, String valueType) throws WSSecurityException - Throws:
WSSecurityException
-
findUnprocessedTokenElement
public static Element findUnprocessedTokenElement(Document doc, WSDocInfo docInfo, String uri, String type) throws WSSecurityException Find a token that has not been processed already - in other words, it searches for the element, rather than trying to access previous results to find the element- Parameters:
doc- Parent DocumentdocInfo- WSDocInfo instanceuri- URI of the elementtype- Type of the element- Returns:
- A DOM element
- Throws:
WSSecurityException
-
findProcessedTokenElement
public static Element findProcessedTokenElement(Document doc, WSDocInfo docInfo, CallbackHandler cb, String uri, String type) throws WSSecurityException Find a token that has been processed already - in other words, it access previous results to find the element, rather than conducting a general search- Parameters:
doc- Parent DocumentdocInfo- WSDocInfo instancecb- CallbackHandler instanceuri- URI of the elementtype- Type of the element- Returns:
- A DOM element
- Throws:
WSSecurityException
-