public X509IssuerSerial(Element element) throws WSSecurityException
{
this.doc = element.getOwnerDocument();
if (! "X509Data".equals(element.getLocalName()))
throw new InvalidSecurityHeaderException("Invalid message, invalid local name on a X509Data element");
element = Util.getFirstChildElement(element);
if (element == null)
throw new InvalidSecurityHeaderException("X509DataElement empty");
if (! element.getLocalName().equals("X509IssuerSerial"))
throw new InvalidSecurityHeaderException("Only X509IssuerSerial is supported for an X509Data element");
element = Util.getFirstChildElement(element);
if (element == null)
throw new InvalidSecurityHeaderException("X509IssuerSerial empty");
while (element != null)
{
String name = element.getLocalName();
if (name.equals("X509IssuerName"))
issuer = XMLUtils.getFullTextChildrenFromElement(element);
else if (name.equals("X509SerialNumber"))
serial = XMLUtils.getFullTextChildrenFromElement(element);
element = Util.getNextSiblingElement(element);
}
if (serial == null)
throw new InvalidSecurityHeaderException("X509SerialNumber missing from X509IssuerSerial");
if (issuer == null)
throw new InvalidSecurityHeaderException("X509IssuerName missing from X509IssuerSerial");
}