String type = element.getAttribute("ValueType");
if (X509Security.X509_V3_TYPE.equals(type)) {
X509Security x509 = new X509Security(element, bspCompliant);
return (BinarySecurity) x509;
} else if (PKIPathSecurity.getType().equals(type)) {
PKIPathSecurity pkiPath = new PKIPathSecurity(element, bspCompliant);
return (BinarySecurity) pkiPath;
}
throw new WSSecurityException(
WSSecurityException.UNSUPPORTED_SECURITY_TOKEN,
"unsupportedBinaryTokenType",