if (attribute == null) {
attribute = new Attribute((ASN1ObjectIdentifier) CONTENT_TYPE
.clone(), (ASN1ObjectIdentifier) oid.clone());
attributes.add(attribute);
} else if (attribute.valueCount() < 1) {
throw new InvalidAttributeException(
"Content type attribute has no value!");
} else if (!attribute.valueAt(0).equals(oid)) {
throw new InvalidAttributeException(
"Content type attribute has wrong value!");