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!");
}
octets = (ASN1OctetString) attribute.valueAt(0);
md_ = octets.getByteArray();
mdalg = JCA.getName(JCA.getDigestOID(sigalg));