throw new IllegalArgumentException("correlationID must not be null");
}
testAndSetInvocation();
Key key = getKey(algorithmURI, algorithmUsage, correlationID);
if (key != null && this.inboundSecurityContext != null) {
AlgorithmSuiteSecurityEvent algorithmSuiteSecurityEvent = new AlgorithmSuiteSecurityEvent();
algorithmSuiteSecurityEvent.setAlgorithmURI(algorithmURI);
algorithmSuiteSecurityEvent.setAlgorithmUsage(algorithmUsage);
algorithmSuiteSecurityEvent.setCorrelationID(correlationID);
if (SecurityTokenConstants.DerivedKeyToken.equals(getTokenType())) {
algorithmSuiteSecurityEvent.setDerivedKey(true);
}
if (key instanceof RSAKey) {
algorithmSuiteSecurityEvent.setKeyLength(((RSAKey) key).getModulus().bitLength());
} else if (key instanceof DSAKey) {
algorithmSuiteSecurityEvent.setKeyLength(((DSAKey) key).getParams().getP().bitLength());
} else if (key instanceof ECKey) {
algorithmSuiteSecurityEvent.setKeyLength(((ECKey) key).getParams().getOrder().bitLength());
} else if (key instanceof SecretKey) {
algorithmSuiteSecurityEvent.setKeyLength(key.getEncoded().length * 8);
} else {
throw new XMLSecurityException("java.security.UnknownKeyType", key.getClass().getName());
}
this.inboundSecurityContext.registerSecurityEvent(algorithmSuiteSecurityEvent);
}