securityToken.addTokenUsage(tokenUsage);
x509TokenSecurityEvent.setSecurityToken(securityToken);
policyEnforcer.registerSecurityEvent(x509TokenSecurityEvent);
if (tokenUsage.getName().contains("Signature") || tokenUsage.getName().contains("Endorsing")) {
SignedElementSecurityEvent signedElementSecurityEvent = new SignedElementSecurityEvent(securityToken, true, protectionOrder);
signedElementSecurityEvent.setElementPath(bstPath);
policyEnforcer.registerSecurityEvent(signedElementSecurityEvent);
}
if (tokenUsage.getName().contains("Endorsing")) {
SignedElementSecurityEvent signedElementSecurityEvent = new SignedElementSecurityEvent(securityToken, true, protectionOrder);
signedElementSecurityEvent.setElementPath(sigPath);
policyEnforcer.registerSecurityEvent(signedElementSecurityEvent);
}
}
SecurityToken mainSignatureToken = null;
Iterator<SecurityToken> securityTokenIterator = securityTokens.iterator();
while (securityTokenIterator.hasNext()) {
SecurityToken securityToken = securityTokenIterator.next();
if (securityToken.getTokenUsages().contains(WSSecurityTokenConstants.TokenUsage_MainSignature)) {
mainSignatureToken = securityToken;
break;
}
}
securityTokenIterator = securityTokens.iterator();
while (securityTokenIterator.hasNext()) {
SecurityToken securityToken = securityTokenIterator.next();
if (securityToken.getTokenUsages().get(0).getName().contains("Signed")) {
SignedElementSecurityEvent signedElementSecurityEvent =
new SignedElementSecurityEvent((InboundSecurityToken)mainSignatureToken, true, protectionOrder);
signedElementSecurityEvent.setElementPath(bstPath);
policyEnforcer.registerSecurityEvent(signedElementSecurityEvent);
}
}
OperationSecurityEvent operationSecurityEvent = new OperationSecurityEvent();