attribute = info_.authenticatedAttributes().getAttribute(
CONTENT_TYPE);
if (attribute == null) {
throw new NoSuchAttributeException(
"ContentType attribute missing!");
}
if (attribute.valueCount() == 0) {
throw new InvalidAttributeException(
"ContentType attribute has no OID!");
}
if (!oid.equals(attribute.valueAt(0))) {
throw new InvalidAttributeException(
"ContentType attribute mismatch!");
}
attribute = info_.authenticatedAttributes().getAttribute(
MESSAGE_DIGEST);
if (attribute == null) {
throw new NoSuchAttributeException(
"MessageDigest attribute missing!");
}
if (attribute.valueCount() == 0) {
throw new InvalidAttributeException(
"MessageDigest attribute has no data!");