if (WSSConstants.NS_X509_V3_TYPE.equals(binarySecurityTokenType.getValueType())) {
binarySecurity = new X509Security(doc);
} else if (WSSConstants.NS_X509PKIPathv1.equals(binarySecurityTokenType.getValueType())) {
binarySecurity = new PKIPathSecurity(doc);
} else if (WSSConstants.NS_GSS_Kerberos5_AP_REQ.equals(binarySecurityTokenType.getValueType())) {
binarySecurity = new KerberosSecurity(doc);
}
binarySecurity.addWSSENamespace();
binarySecurity.addWSUNamespace();
binarySecurity.setEncodingType(binarySecurityTokenType.getEncodingType());