public class PolicyBasedResultsValidator extends Object implements ExtendedPolicyValidatorCallbackHandler
Constructor and Description |
---|
PolicyBasedResultsValidator() |
Modifier and Type | Method and Description |
---|---|
static org.apache.ws.security.WSSecurityEngineResult[] |
fetchActionResults(List<org.apache.ws.security.WSSecurityEngineResult> wsSecurityEngineResults,
int action) |
protected ArrayList |
getEncryptedReferences(List<org.apache.ws.security.WSSecurityEngineResult> results) |
protected List<org.apache.ws.security.WSSecurityEngineResult> |
getResults(List<org.apache.ws.security.WSSecurityEngineResult> results,
int action) |
protected List<Integer> |
getSigEncrActions(List<org.apache.ws.security.WSSecurityEngineResult> results) |
protected void |
handleSupportingTokens(List<org.apache.ws.security.WSSecurityEngineResult> results,
SupportingToken suppTok) |
protected boolean |
isCertificateInKeyStore(org.apache.ws.security.components.crypto.Crypto crypto,
X509Certificate cert)
Check to see if the certificate argument is in the keystore
TODO Directly copied from WSS4J (SignatureTrustValidator) - Optimize later
|
protected boolean |
isCertificateTrusted(X509Certificate cert,
org.apache.ws.security.components.crypto.Crypto crypto)
TODO - This is directly copied from WSS4J (SignatureTrustValidator).
|
protected boolean |
isSignatureRequired(RampartMessageData rmd) |
protected boolean |
isUsernameTokenPresent(SupportingToken suppTok) |
protected boolean |
isUsernameTokenPresent(ValidatorData data) |
void |
validate(ValidatorData data,
List<org.apache.ws.security.WSSecurityEngineResult> results)
Validate policy based results.
|
void |
validate(ValidatorData data,
Vector results)
Validate policy based results.
|
protected void |
validateEncrSig(ValidatorData data,
List<org.apache.ws.security.WSEncryptionPart> encryptedParts,
List<org.apache.ws.security.WSEncryptionPart> signatureParts,
List<org.apache.ws.security.WSSecurityEngineResult> results) |
protected void |
validateEncryptedParts(ValidatorData data,
List<org.apache.ws.security.WSEncryptionPart> encryptedParts,
List<org.apache.ws.security.WSSecurityEngineResult> results) |
protected void |
validateProtectionOrder(ValidatorData data,
List<org.apache.ws.security.WSSecurityEngineResult> results) |
void |
validateRequiredElements(ValidatorData data) |
protected void |
validateSignedPartsHeaders(ValidatorData data,
List<org.apache.ws.security.WSEncryptionPart> signatureParts,
List<org.apache.ws.security.WSSecurityEngineResult> results) |
protected void |
validateSupportingTokens(ValidatorData data,
List<org.apache.ws.security.WSSecurityEngineResult> results) |
protected boolean |
verifyTimestamp(org.apache.ws.security.message.token.Timestamp timestamp,
RampartMessageData rmd) |
protected boolean |
verifyTrust(X509Certificate cert,
RampartMessageData rmd)
Evaluate whether a given certificate should be trusted.
|
public void validate(ValidatorData data, Vector results) throws RampartException
PolicyValidatorCallbackHandler
validate
in interface PolicyValidatorCallbackHandler
data
- validator dataresults
- policy based ws-security resultsRampartException
- Rampart exceptionpublic void validate(ValidatorData data, List<org.apache.ws.security.WSSecurityEngineResult> results) throws RampartException
validate
in interface ExtendedPolicyValidatorCallbackHandler
data
- validator dataresults
- policy based ws-security resultsRampartException
- Rampart exceptionprotected void validateEncrSig(ValidatorData data, List<org.apache.ws.security.WSEncryptionPart> encryptedParts, List<org.apache.ws.security.WSEncryptionPart> signatureParts, List<org.apache.ws.security.WSSecurityEngineResult> results) throws RampartException
encryptedParts
- signatureParts
- RampartException
protected void validateSupportingTokens(ValidatorData data, List<org.apache.ws.security.WSSecurityEngineResult> results) throws RampartException
data
- results
- RampartException
protected void handleSupportingTokens(List<org.apache.ws.security.WSSecurityEngineResult> results, SupportingToken suppTok) throws RampartException
results
- suppTok
- RampartException
protected void validateProtectionOrder(ValidatorData data, List<org.apache.ws.security.WSSecurityEngineResult> results) throws RampartException
data
- results
- RampartException
protected List<Integer> getSigEncrActions(List<org.apache.ws.security.WSSecurityEngineResult> results)
protected void validateEncryptedParts(ValidatorData data, List<org.apache.ws.security.WSEncryptionPart> encryptedParts, List<org.apache.ws.security.WSSecurityEngineResult> results) throws RampartException
RampartException
public void validateRequiredElements(ValidatorData data) throws RampartException
RampartException
protected void validateSignedPartsHeaders(ValidatorData data, List<org.apache.ws.security.WSEncryptionPart> signatureParts, List<org.apache.ws.security.WSSecurityEngineResult> results) throws RampartException
RampartException
protected boolean isSignatureRequired(RampartMessageData rmd)
protected boolean verifyTimestamp(org.apache.ws.security.message.token.Timestamp timestamp, RampartMessageData rmd) throws RampartException
RampartException
protected boolean verifyTrust(X509Certificate cert, RampartMessageData rmd) throws RampartException
Policy used in this implementation: 1. Search the keystore for the transmitted certificate 2. Search the keystore for a connection to the transmitted certificate (that is, search for certificate(s) of the issuer of the transmitted certificate 3. Verify the trust path for those certificates found because the search for the issuer might be fooled by a phony DN (String!)
cert
- the certificate that should be validated against the keystorermd
- To get signature keystore information.RampartException
- If an error occurred during validation.protected boolean isCertificateTrusted(X509Certificate cert, org.apache.ws.security.components.crypto.Crypto crypto) throws RampartException
cert
- the certificate that should be validated against the keystorecrypto
- A crypto instance to use for trust validationRampartException
- If an error occurred during validation.protected boolean isCertificateInKeyStore(org.apache.ws.security.components.crypto.Crypto crypto, X509Certificate cert) throws RampartException
crypto
- A Crypto instance to use for trust validationcert
- The certificate to checkRampartException
- If certificates are not found for given issuer and serial number.protected ArrayList getEncryptedReferences(List<org.apache.ws.security.WSSecurityEngineResult> results)
protected List<org.apache.ws.security.WSSecurityEngineResult> getResults(List<org.apache.ws.security.WSSecurityEngineResult> results, int action)
protected boolean isUsernameTokenPresent(ValidatorData data)
protected boolean isUsernameTokenPresent(SupportingToken suppTok)
public static org.apache.ws.security.WSSecurityEngineResult[] fetchActionResults(List<org.apache.ws.security.WSSecurityEngineResult> wsSecurityEngineResults, int action)
Copyright © Apache Software Foundation. All Rights Reserved.