return returnKey;
}
private static Key processX509Data(KeyInfoHeaderBlock keyInfo, CallbackHandler callbackHandler)throws XWSSecurityException {
SecurityEnvironment secEnv = new DefaultSecurityEnvironmentImpl(callbackHandler);
X509Data x509Data = keyInfo.getX509Data(0);
X509Certificate cert = null;
try {
if (x509Data.containsCertificate()) {
cert = (x509Data.itemCertificate(0)).getX509Certificate();
} else if (x509Data.containsSKI()) {
return secEnv.getPrivateKey(null, x509Data.itemSKI(0).getSKIBytes());
} else if (x509Data.containsIssuerSerial()) {
return secEnv.getPrivateKey(null,
x509Data.itemIssuerSerial(0).getSerialNumber(),
x509Data.itemIssuerSerial(0).getIssuerName());
} else {
log.log(Level.SEVERE, "WSS0339.unsupported.keyinfo");
throw new XWSSecurityException(
"Unsupported child element of X509Data encountered");
}