AsymmetricBindingProcessorpublic class AsymmetricBindingProcessor extends BindingProcessor
Fields Summary |
---|
private com.sun.xml.ws.security.policy.AsymmetricBinding | binding |
Constructors Summary |
---|
public AsymmetricBindingProcessor(com.sun.xml.ws.security.policy.AsymmetricBinding asBinding, XWSSPolicyContainer container, boolean isServer, boolean isIncoming, Vector signedParts, Vector encryptedParts, Vector signedElements, Vector encryptedElements)Creates a new instance of AsymmetricBindingProcessor
this.binding = asBinding;
this.container = container;
this.isServer = isServer;
this.isIncoming = isIncoming;
protectionOrder = binding.getProtectionOrder();
tokenProcessor = new TokenProcessor(isServer,isIncoming,pid);
iAP = new IntegrityAssertionProcessor(binding.getAlgorithmSuite(),binding.isSignContent());
eAP = new EncryptionAssertionProcessor(binding.getAlgorithmSuite(),false);
this.signedParts = signedParts;
this.signedElements = signedElements;
this.encryptedElements = encryptedElements;
this.encryptedParts = encryptedParts;
|
Methods Summary |
---|
protected void | close()
if(protectionOrder == Binding.SIGN_ENCRYPT){
container.insert(primaryEP);
}
| protected com.sun.xml.ws.security.policy.Binding | getBinding()
return binding;
| protected com.sun.xml.ws.security.policy.Token | getEncryptionToken()
if((isServer && !isIncoming) || (!isServer && isIncoming)){
return binding.getInitiatorToken();
}else{
return binding.getRecipientToken();
}
| protected com.sun.xml.wss.impl.policy.mls.EncryptionPolicy | getSecondaryEncryptionPolicy()
if(sEncPolicy == null){
sEncPolicy = new EncryptionPolicy();
sEncPolicy.setUUID(pid.generateID());
Token token = null;
token = getEncryptionToken();
tokenProcessor.addKeyBinding(sEncPolicy,token,false);
container.insert(sEncPolicy);
}
return sEncPolicy;
| protected com.sun.xml.ws.security.policy.Token | getSignatureToken()
if((isServer && !isIncoming) || (!isServer && isIncoming)){
return binding.getRecipientToken();
}else{
return binding.getInitiatorToken();
}
| public void | process()
Token st = getSignatureToken();
Token et = getEncryptionToken();
if(st != null){
primarySP = new SignaturePolicy();
primarySP.setUUID(pid.generateID());
if(logger.isLoggable(Level.FINEST)){
logger.log(Level.FINEST,"ID of Primary signature policy is "+primarySP.getUUID());
}
tokenProcessor.addKeyBinding(primarySP,st,true);
SignaturePolicy.FeatureBinding spFB = (com.sun.xml.wss.impl.policy.mls.SignaturePolicy.FeatureBinding)
primarySP.getFeatureBinding();
//spFB.setCanonicalizationAlgorithm(CanonicalizationMethod.EXCLUSIVE);
SecurityPolicyUtil.setCanonicalizationMethod(spFB, binding.getAlgorithmSuite());
spFB.isPrimarySignature(true);
}
if(et != null){
primaryEP = new EncryptionPolicy();
primaryEP.setUUID(pid.generateID());
tokenProcessor.addKeyBinding(primaryEP,et,false);
if(logger.isLoggable(Level.FINEST)){
logger.log(Level.FINEST,"ID of Encryption policy is "+primaryEP.getUUID());
}
}
if(protectionOrder == Binding.SIGN_ENCRYPT){
container.insert(primarySP);
}else{
container.insert(primaryEP);
container.insert(primarySP);
}
addPrimaryTargets();
if(foundEncryptTargets && binding.getSignatureProtection()){
if(logger.isLoggable(Level.FINEST)){
logger.log(Level.FINEST,"PrimarySignature will be Encrypted");
}
protectPrimarySignature();
}
if(binding.isIncludeTimeStamp()){
if(logger.isLoggable(Level.FINEST)){
logger.log(Level.FINEST,"Timestamp header will be added to the message and will be Integrity protected ");
}
protectTimestamp();
}
if(binding.getTokenProtection()){
if(logger.isLoggable(Level.FINEST)){
logger.log(Level.FINEST,"Token reference by primary signature with ID "+primarySP.getUUID()+" will be Integrity protected");
}
protectToken((WSSPolicy) primarySP.getKeyBinding());
}
|
|