if (this.isRequestor()) {
Vector<byte[]> signatureValues = new Vector<byte[]>();
ais = aim.get(SP12Constants.SIGNED_SUPPORTING_TOKENS);
if (ais != null) {
SupportingToken sgndSuppTokens = null;
for (AssertionInfo ai : ais) {
sgndSuppTokens = (SupportingToken)ai.getAssertion();
ai.setAsserted(true);
}
if (sgndSuppTokens != null) {
addUsernameTokens(sgndSuppTokens);
}
}
ais = aim.get(SP12Constants.SIGNED_ENDORSING_SUPPORTING_TOKENS);
if (ais != null) {
SupportingToken sgndSuppTokens = null;
for (AssertionInfo ai : ais) {
sgndSuppTokens = (SupportingToken)ai.getAssertion();
ai.setAsserted(true);
}
if (sgndSuppTokens != null) {
SignedEncryptedParts signdParts = sgndSuppTokens.getSignedParts();
for (Token token : sgndSuppTokens.getTokens()) {
if (token instanceof IssuedToken
|| token instanceof SecureConversationToken
|| token instanceof KeyValueToken) {
addSig(signatureValues, doIssuedTokenSignature(token, signdParts,
sgndSuppTokens,
null));
} else if (token instanceof X509Token
|| token instanceof KeyValueToken) {
addSig(signatureValues, doX509TokenSignature(token,
signdParts,
sgndSuppTokens));
}
}
}
}
ais = aim.get(SP12Constants.SIGNED_ENCRYPTED_SUPPORTING_TOKENS);
if (ais != null) {
SupportingToken sgndSuppTokens = null;
for (AssertionInfo ai : ais) {
sgndSuppTokens = (SupportingToken)ai.getAssertion();
ai.setAsserted(true);
}
if (sgndSuppTokens != null) {
addUsernameTokens(sgndSuppTokens);
}
}
ais = aim.get(SP12Constants.ENDORSING_SUPPORTING_TOKENS);
if (ais != null) {
SupportingToken endSuppTokens = null;
for (AssertionInfo ai : ais) {
endSuppTokens = (SupportingToken)ai.getAssertion();
ai.setAsserted(true);
}
if (endSuppTokens != null) {
for (Token token : endSuppTokens.getTokens()) {
if (token instanceof IssuedToken
|| token instanceof SecureConversationToken) {
addSig(signatureValues, doIssuedTokenSignature(token,
endSuppTokens
.getSignedParts(),
endSuppTokens,
null));
} else if (token instanceof X509Token
|| token instanceof KeyValueToken) {
addSig(signatureValues, doX509TokenSignature(token,
endSuppTokens.getSignedParts(),
endSuppTokens));
}
}
}
}
ais = aim.get(SP12Constants.SUPPORTING_TOKENS);
if (ais != null) {
SupportingToken suppTokens = null;
for (AssertionInfo ai : ais) {
suppTokens = (SupportingToken)ai.getAssertion();
ai.setAsserted(true);
}
if (suppTokens != null && suppTokens.getTokens() != null
&& suppTokens.getTokens().size() > 0) {
handleSupportingTokens(suppTokens, false);
}
}
} else {