byte[] buf = new byte[ token.length - index ];
System.arraycopy(token, index, buf, 0, token.length - index);
ObjectIdentifier mechoid = getOID(buf);
if(_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE,"Comparing mech OID in token with the expected mech OID");
_logger.log(Level.FINE,"mech OID: " + dumpHex(getDER(mechoid)));
_logger.log(Level.FINE,"expected mech OID: " + dumpHex(getDER(oid)));
}
if ( ! mechoid.equals(oid)) {
if(_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE,"mech OID in token does not match expected mech OID");
}
throw new IOException("Defective token");
}