SecurityContext invSC = mi.getSecurityContext();
if(invSC != null)
{
CertificateIdentityFactory identityFactory = (CertificateIdentityFactory)
IdentityFactory.getFactory(IdentityType.CERTIFICATE);
CertificateIdentity certIdentity = identityFactory.createIdentity(caller, certs, null);
invSC.getUtil().clearIdentities(CredentialIdentity.class);
invSC.getUtil().addIdentity(certIdentity);
}
}
}