String valueType = getAttribute("ValueType");
// BSP:3031: ValueType MUST always be specified
if (isBSP && valueType.length()<1) {
log.log(Level.SEVERE, "BSP3031.ValueType.NotPresent");
throw new SecurityTokenException("Any wsse:BinarySecurityToken in a SECURE_ENVELOPE MUST have an ValueType attribute.");
}
if (!"".equals(valueType)) {
setValueType(valueType);
}
if (isBSP) {
String encoding = getAttribute("EncodingType");
// BSP:R3029: encodingType MUST be specified.
if (encodingType.length()<1) {
log.log(Level.SEVERE, "BSP3029.EncodingType.NotPresent");
throw new SecurityTokenException("Any wsse:BinarySecurityToken in a SECURE_ENVELOPE MUST have an EncodingType attribute.");
}
if (!encodingType.equalsIgnoreCase(MessageConstants.BASE64_ENCODING_NS))
{
log.log(Level.SEVERE, "BSP3030.EncodingType.Invalid");
throw new SecurityTokenException("EncodingType attribute value in wsse:BinarySecurityToken is invalid.");
}
if (!"".equals(encoding)) {
setEncodingType(encoding);
}